Fix the incorrect logic of threat online status check. Also add targets in other map or phase to offline container.

This commit is contained in:
megamage
2011-09-20 10:26:34 -04:00
parent 8aead2a1ee
commit 4ccb22e1a6

View File

@@ -178,11 +178,13 @@ void HostileReference::updateOnlineStatus()
// ref is valid
// target is no player or not gamemaster
// target is not in flight
if (isValid() &&
((getTarget()->GetTypeId() != TYPEID_PLAYER || !getTarget()->ToPlayer()->isGameMaster()) ||
!getTarget()->HasUnitState(UNIT_STAT_IN_FLIGHT)))
if (isValid()
&& (getTarget()->GetTypeId() != TYPEID_PLAYER || !getTarget()->ToPlayer()->isGameMaster())
&& !getTarget()->HasUnitState(UNIT_STAT_IN_FLIGHT)
&& getTarget()->IsInMap(getSourceUnit())
)
{
Creature* creature = getSourceUnit()->ToCreature();
Creature* creature = getSourceUnit()->ToCreature();
online = getTarget()->isInAccessiblePlaceFor(creature);
if (!online)
{