v2.2.0: added a couple safety checks to the object examine function

This commit is contained in:
Evan Debenham
2023-09-05 11:51:37 -04:00
parent cb700b445c
commit 741321bab9
@@ -1490,13 +1490,13 @@ public class GameScene extends PixelScene {
public static void examineObject(Object o){
if (o == Dungeon.hero){
GameScene.show( new WndHero() );
} else if ( o instanceof Mob ){
} else if ( o instanceof Mob && ((Mob) o).isActive() ){
GameScene.show(new WndInfoMob((Mob) o));
if (o instanceof Snake && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_SURPRISE_ATKS)){
GLog.p(Messages.get(Guidebook.class, "hint"));
GameScene.flashForDocument(Document.ADVENTURERS_GUIDE, Document.GUIDE_SURPRISE_ATKS);
}
} else if ( o instanceof Heap ){
} else if ( o instanceof Heap && !((Heap) o).isEmpty() ){
GameScene.show(new WndInfoItem((Heap)o));
} else if ( o instanceof Plant ){
GameScene.show( new WndInfoPlant((Plant) o) );