diff options
-rwxr-xr-x | src/server/game/Combat/ThreatManager.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 58d46dda62f..e5a2460b1a6 100755 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -74,6 +74,10 @@ bool ThreatCalcHelper::isValidProcess(Unit* hatedUnit, Unit* hatingUnit, SpellIn if (!hatedUnit->isAlive() || !hatingUnit->isAlive()) return false; + // not in same map or phase + if (!hatedUnit->IsInMap(hatingUnit)) + return false; + // spell not causing threat if (threatSpell && threatSpell->AttributesEx & SPELL_ATTR1_NO_THREAT) return false; @@ -174,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) { |