v2.2.0: added a couple safety checks to the object examine function
This commit is contained in:
@@ -1490,13 +1490,13 @@ public class GameScene extends PixelScene {
|
|||||||
public static void examineObject(Object o){
|
public static void examineObject(Object o){
|
||||||
if (o == Dungeon.hero){
|
if (o == Dungeon.hero){
|
||||||
GameScene.show( new WndHero() );
|
GameScene.show( new WndHero() );
|
||||||
} else if ( o instanceof Mob ){
|
} else if ( o instanceof Mob && ((Mob) o).isActive() ){
|
||||||
GameScene.show(new WndInfoMob((Mob) o));
|
GameScene.show(new WndInfoMob((Mob) o));
|
||||||
if (o instanceof Snake && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_SURPRISE_ATKS)){
|
if (o instanceof Snake && !Document.ADVENTURERS_GUIDE.isPageRead(Document.GUIDE_SURPRISE_ATKS)){
|
||||||
GLog.p(Messages.get(Guidebook.class, "hint"));
|
GLog.p(Messages.get(Guidebook.class, "hint"));
|
||||||
GameScene.flashForDocument(Document.ADVENTURERS_GUIDE, Document.GUIDE_SURPRISE_ATKS);
|
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));
|
GameScene.show(new WndInfoItem((Heap)o));
|
||||||
} else if ( o instanceof Plant ){
|
} else if ( o instanceof Plant ){
|
||||||
GameScene.show( new WndInfoPlant((Plant) o) );
|
GameScene.show( new WndInfoPlant((Plant) o) );
|
||||||
|
|||||||
Reference in New Issue
Block a user