diff options
| author | megamage <none@none.none> | 2011-09-20 10:24:44 -0400 | 
|---|---|---|
| committer | megamage <none@none.none> | 2011-09-20 10:24:44 -0400 | 
| commit | 8aead2a1eea446c3a8ca40ac7c3c9ad13bc88ef9 (patch) | |
| tree | 8a6a8080390631ef34e405b522463ff2a154ef16 /src/server/game/Combat/ThreatManager.cpp | |
| parent | 3d4f9a0d1c1b5a3f17969615d8a6d495a0699e46 (diff) | |
Do not add spell-caused threat to creatures in other map or phase. Fix crashes #2396 and #2992.
Note: Threat system is still thread-unsafe. This patch only reduces the chance of crash.
Diffstat (limited to 'src/server/game/Combat/ThreatManager.cpp')
| -rwxr-xr-x | src/server/game/Combat/ThreatManager.cpp | 4 | 
1 files changed, 4 insertions, 0 deletions
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 58d46dda62f..4d426d1a5af 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;  | 
