aboutsummaryrefslogtreecommitdiff
path: root/src/game/GameObject.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-04 16:30:20 -0600
committermegamage <none@none>2009-02-04 16:30:20 -0600
commitae5e608c00bde11f8c1178b3f1f07bab4f855272 (patch)
tree1dac8a03072aa0194d4d6343ef6e5418ca61619c /src/game/GameObject.cpp
parentee65a34544a62c19a62b75822672ea88788a8afc (diff)
*Fix a crash bug in the previous rev.
--HG-- branch : trunk
Diffstat (limited to 'src/game/GameObject.cpp')
-rw-r--r--src/game/GameObject.cpp5
1 files changed, 3 insertions, 2 deletions
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;
}