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;
|
String desc;
|
||||||
if (anonymous && (handler == null || !handler.isKnown( this ))){
|
if (anonymous && (handler == null || !handler.isKnown( this ))){
|
||||||
desc = desc();
|
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());
|
Notes.CustomRecord note = Notes.findCustomRecord(getClass());
|
||||||
if (note != null){
|
if (note != null){
|
||||||
desc = Messages.get(this, "custom_note", note.title()) + "\n\n" + super.info();
|
desc = Messages.get(this, "custom_note", note.title()) + "\n\n" + super.info();
|
||||||
} else {
|
} else {
|
||||||
desc = super.info();
|
desc = super.info();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
desc = super.info();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cursed && isEquipped( Dungeon.hero )) {
|
if (cursed && isEquipped( Dungeon.hero )) {
|
||||||
|
|||||||
@@ -623,18 +623,18 @@ public class Notes {
|
|||||||
|
|
||||||
public static CustomRecord findCustomRecord( int ID ){
|
public static CustomRecord findCustomRecord( int ID ){
|
||||||
for (Record rec : records){
|
for (Record rec : records){
|
||||||
if (rec instanceof CustomRecord && ((CustomRecord) rec).ID == ID)
|
if (rec instanceof CustomRecord && ((CustomRecord) rec).ID == ID) {
|
||||||
return (CustomRecord) rec;
|
return (CustomRecord) rec;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static CustomRecord findCustomRecord( Class itemClass ){
|
public static CustomRecord findCustomRecord( Class itemClass ){
|
||||||
for (Record rec : records){
|
for (Record rec : records){
|
||||||
if (rec instanceof CustomRecord
|
if (rec instanceof CustomRecord && ((CustomRecord) rec).itemClass == itemClass) {
|
||||||
&& ((CustomRecord) rec).itemClass == itemClass
|
|
||||||
&& ((CustomRecord) rec).ID == -1)
|
|
||||||
return (CustomRecord) rec;
|
return (CustomRecord) rec;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user