Skip to content

Commit

Permalink
Fix "No such index" display for search names of CRE resources
Browse files Browse the repository at this point in the history
  • Loading branch information
Argent77 committed Jun 28, 2024
1 parent dcd18c3 commit a7f717d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/org/infinity/resource/cre/CreResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -712,9 +712,11 @@ public static String getSearchString(InputStream is) throws IOException {
if (sig.equals("CHR ")) {
retVal = StreamUtils.readString(is, 32);
} else {
String name = StringTable.getStringRef(StreamUtils.readInt(is));
String shortName = StringTable.getStringRef(StreamUtils.readInt(is));
if (name.equals(shortName)) {
final int strrefName = StreamUtils.readInt(is);
final int strrefShortName = StreamUtils.readInt(is);
final String name = StringTable.getStringRef(strrefName).trim();
final String shortName = StringTable.getStringRef(strrefShortName).trim();
if (strrefName == strrefShortName || strrefShortName < 0 || name.equals(shortName) || shortName.isEmpty()) {
retVal = name;
} else {
retVal = name + " - " + shortName;
Expand Down

0 comments on commit a7f717d

Please sign in to comment.