From ae5e608c00bde11f8c1178b3f1f07bab4f855272 Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 4 Feb 2009 16:30:20 -0600 Subject: *Fix a crash bug in the previous rev. --HG-- branch : trunk --- src/game/GameObject.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/game/GameObject.cpp') diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 6b7b2046adf..b7487568e62 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -718,9 +718,10 @@ bool GameObject::isVisibleForInState(Player const* u, bool inVisibleList) const return false; // special invisibility cases - if(GetGOInfo()->type == GAMEOBJECT_TYPE_TRAP && GetGOInfo()->trap.stealthed && u->IsHostileTo(GetOwner())) + if(GetGOInfo()->type == GAMEOBJECT_TYPE_TRAP && GetGOInfo()->trap.stealthed) { - if(!canDetectTrap(u, GetDistance(u))) + Unit *owner = GetOwner(); + if(owner && u->IsHostileTo(owner) && !canDetectTrap(u, GetDistance(u))) return false; } -- cgit v1.2.3