diff options
| author | Ovah <dreadkiller@gmx.de> | 2020-08-07 14:51:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-07 14:51:40 +0200 |
| commit | 764f22fc9157ad184baa38995ee4e2d821299935 (patch) | |
| tree | dd6d9432476de51df4fdd1777096b55de5b83cdf /src/server/game/Combat/CombatManager.cpp | |
| parent | 98b1b20d6beea5e2fdea7e404e8d880953d4b2fb (diff) | |
Core/Units: add new functionality for units to block or enable combat interactions (#25168)
* Core/Units: add new functionality for units to block or enable combat entirely via helper to reflect what CREATURE_DIFFICULTYFLAGS_IGNORE_COMBAT and client AI functions imply
* yeah...
* Nuke Creature::IsCombatDisallowed helper as its unused by now
* no combat extra flag may now be changed on transforms if the transformed entry does not have the flag
Diffstat (limited to 'src/server/game/Combat/CombatManager.cpp')
| -rw-r--r-- | src/server/game/Combat/CombatManager.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/server/game/Combat/CombatManager.cpp b/src/server/game/Combat/CombatManager.cpp index c2774a23ec2..0d396b73aa6 100644 --- a/src/server/game/Combat/CombatManager.cpp +++ b/src/server/game/Combat/CombatManager.cpp @@ -44,12 +44,9 @@ return false; if (a->HasUnitState(UNIT_STATE_IN_FLIGHT) || b->HasUnitState(UNIT_STATE_IN_FLIGHT)) return false; - if (Creature const* aCreature = a->ToCreature()) - if (aCreature->IsCombatDisallowed()) - return false; - if (Creature const* bCreature = b->ToCreature()) - if (bCreature->IsCombatDisallowed()) - return false; + // ... both units must not be ignoring combat + if (a->IsIgnoringCombat() || b->IsIgnoringCombat()) + return false; if (a->IsFriendlyTo(b) || b->IsFriendlyTo(a)) return false; Player const* playerA = a->GetCharmerOrOwnerPlayerOrPlayerItself(); |
