diff options
Diffstat (limited to 'src/game/GameObject.cpp')
-rw-r--r-- | src/game/GameObject.cpp | 5 |
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; } |