aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2019-01-19 17:41:03 +0100
committerShauren <shauren.trinity@gmail.com>2021-11-21 21:09:36 +0100
commit36468203ddf9adb1a4c64f663aff6505701b8fb6 (patch)
tree3828e86ef7d26f8b592c063d24b6f2b28fa0c6c6 /src
parentbdcec63b610575b38ba997dfc3fb0e3eed8e01cc (diff)
Core/Spells: Fix assert triggered
Fix assert triggered when a spell would trigger another spell in OnEffectHitTarget that would kill the target, then processing the main spell effects. The triggered spell can kill the target, changing its death state to CORPSE and removing auras created. Fix #22306 (cherry picked from commit 518e6299ca08a362bc3709daaaa5e5d5633d1bf1)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 04832ca3898..639e6e33593 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -3184,8 +3184,9 @@ AuraApplication* Unit::_CreateAuraApplication(Aura* aura, uint32 effMask)
{
// can't apply aura on unit which is going to be deleted - to not create a memory leak
ASSERT(!m_cleanupDone);
- // aura musn't be removed
- ASSERT(!aura->IsRemoved());
+ // aura musn't be removed (but it could have been removed by OnEffectHitTarget script handler
+ // casting a spell that killed the target and set deathState to CORPSE)
+ ASSERT(!aura->IsRemoved() || !IsAlive());
// aura mustn't be already applied on target
ASSERT (!aura->IsAppliedOnTarget(GetGUID()) && "Unit::_CreateAuraApplication: aura musn't be applied on target");