*Fix a crash bug in the previous rev.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-02-04 16:30:20 -06:00
parent ee65a34544
commit ae5e608c00

View File

@@ -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;
}