mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
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
This commit is contained in:
@@ -3291,8 +3291,9 @@ AuraApplication* Unit::_CreateAuraApplication(Aura* aura, uint8 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");
|
||||
|
||||
Reference in New Issue
Block a user