v2.5.0: fixed enchant/glyph cleansing resulting in crashes

This commit is contained in:
Evan Debenham
2024-06-20 17:00:50 -04:00
parent f0542ebf1e
commit 351a74c567
2 changed files with 2 additions and 2 deletions

View File

@@ -635,7 +635,7 @@ public class Armor extends EquipableItem {
if (seal != null){
seal.setGlyph(glyph);
}
if (isIdentified() && Dungeon.hero != null
if (glyph != null && isIdentified() && Dungeon.hero != null
&& Dungeon.hero.isAlive() && Dungeon.hero.belongings.contains(this)){
Catalog.setSeen(glyph.getClass());
}

View File

@@ -353,7 +353,7 @@ abstract public class Weapon extends KindOfWeapon {
if (ench == null || !ench.curse()) curseInfusionBonus = false;
enchantment = ench;
updateQuickslot();
if (isIdentified() && Dungeon.hero != null
if (ench != null && isIdentified() && Dungeon.hero != null
&& Dungeon.hero.isAlive() && Dungeon.hero.belongings.contains(this)){
Catalog.setSeen(ench.getClass());
}