Skip to content

Commit

Permalink
Fixed 2DA resref detection issues in script editor and compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Argent77 committed May 26, 2017
1 parent 10040e2 commit 5a39c27
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/org/infinity/gui/ScriptTextArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ private InteractiveToken updateStringToken(Token token)
retVal.resourceEntries.addAll(resList);
retVal.resourceEntries.add(ResourceFactory.getResourceEntry("SPELL.IDS"));
break;
} else if (Character.isUpperCase(type.charAt(0))) {
} else if (Character.isUpperCase(type.charAt(0)) || Character.isDigit(type.charAt(0))) {
// regular resource
if (!"ARE".equals(type) || !ScriptInfo.getInfo().isGlobalScope(token.getLexeme())) {
String resRef = value + '.' + type;
Expand Down
2 changes: 1 addition & 1 deletion src/org/infinity/resource/bcs/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ private void checkParams(ScriptNode node)
checkSpellList(param, value, node);
found = true;
break;
} else if (Character.isUpperCase(resType.charAt(0))) {
} else if (Character.isUpperCase(resType.charAt(0)) || Character.isDigit(resType.charAt(0)) ) {
if (value.length() <= 8) {
// checking resource
if (value.isEmpty()) {
Expand Down
3 changes: 2 additions & 1 deletion src/org/infinity/resource/bcs/Decompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,8 @@ private String generateStringComment(String value, Signatures.Function.Parameter
}
sb.append(']');
break;
} else if (Character.isUpperCase(type.charAt(0)) && value.length() <= 8) {
} else if ((Character.isUpperCase(type.charAt(0)) || Character.isDigit(type.charAt(0))) &&
value.length() <= 8) {
if (!type.equals("ARE") || !ScriptInfo.getInfo().isGlobalScope(value)) {
// resolving resource name
String resRef = value + '.' + type;
Expand Down

0 comments on commit 5a39c27

Please sign in to comment.