v2.5.0: fixed revently introduced error with custom notes by item type
This commit is contained in:
@@ -182,14 +182,17 @@ public class Ring extends KindofMisc {
|
||||
String desc;
|
||||
if (anonymous && (handler == null || !handler.isKnown( this ))){
|
||||
desc = desc();
|
||||
} else {
|
||||
//otherwise, check for item type note too, rings can have either
|
||||
|
||||
//otherwise, check for item type note, rings can have either but not both
|
||||
} else if (Notes.findCustomRecord(customNoteID) == null) {
|
||||
Notes.CustomRecord note = Notes.findCustomRecord(getClass());
|
||||
if (note != null){
|
||||
desc = Messages.get(this, "custom_note", note.title()) + "\n\n" + super.info();
|
||||
} else {
|
||||
desc = super.info();
|
||||
}
|
||||
} else {
|
||||
desc = super.info();
|
||||
}
|
||||
|
||||
if (cursed && isEquipped( Dungeon.hero )) {
|
||||
|
||||
@@ -623,18 +623,18 @@ public class Notes {
|
||||
|
||||
public static CustomRecord findCustomRecord( int ID ){
|
||||
for (Record rec : records){
|
||||
if (rec instanceof CustomRecord && ((CustomRecord) rec).ID == ID)
|
||||
if (rec instanceof CustomRecord && ((CustomRecord) rec).ID == ID) {
|
||||
return (CustomRecord) rec;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static CustomRecord findCustomRecord( Class itemClass ){
|
||||
for (Record rec : records){
|
||||
if (rec instanceof CustomRecord
|
||||
&& ((CustomRecord) rec).itemClass == itemClass
|
||||
&& ((CustomRecord) rec).ID == -1)
|
||||
if (rec instanceof CustomRecord && ((CustomRecord) rec).itemClass == itemClass) {
|
||||
return (CustomRecord) rec;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user