Skip to content
Browse files

Do not add spell-caused threat to creatures in other map or phase. Fi…

…x crashes #2396 and #2992.

Note: Threat system is still thread-unsafe. This patch only reduces the chance of crash.
  • Loading branch information...
1 parent 3d4f9a0 commit 8aead2a1eea446c3a8ca40ac7c3c9ad13bc88ef9 megamage committed Sep 20, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/server/game/Combat/ThreatManager.cpp
View
4 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;

0 comments on commit 8aead2a

Please sign in to comment.
Something went wrong with that request. Please try again.