refactor(Core/Misc): Make DeathState enum class (#17607)

This commit is contained in:
Kitzunu
2023-10-28 10:54:03 +02:00
committed by GitHub
parent 79b39f9655
commit f757e93da5
47 changed files with 112 additions and 112 deletions

View File

@@ -1755,7 +1755,7 @@ void AuraEffect::HandleSpiritOfRedemption(AuraApplication const* aurApp, uint8 m
// die at aura end
else if (target->IsAlive())
// call functions which may have additional effects after chainging state of unit
target->setDeathState(JUST_DIED);
target->setDeathState(DeathState::JustDied);
// xinef: damage immunity spell, not needed because of 93 aura (adds non_attackable state)
// xinef: probably blizzard added it just in case in wotlk (id > 46000)

View File

@@ -4514,7 +4514,7 @@ void Spell::finish(bool ok)
if (spellInfo && spellInfo->SpellIconID == 2056)
{
LOG_DEBUG("spells.aura", "Statue {} is unsummoned in spell {} finish", m_caster->GetGUID().ToString(), m_spellInfo->Id);
m_caster->setDeathState(JUST_DIED);
m_caster->setDeathState(DeathState::JustDied);
return;
}
}

View File

@@ -3829,7 +3829,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
caster->RewardPlayerAndGroupAtEvent(18388, unitTarget);
if (Creature* target = unitTarget->ToCreature())
{
target->setDeathState(CORPSE);
target->setDeathState(DeathState::Corpse);
target->RemoveCorpse();
}
}
@@ -5247,7 +5247,7 @@ void Spell::EffectResurrectPet(SpellEffIndex /*effIndex*/)
pet->Relocate(x, y, z, player->GetOrientation()); // This is needed so SaveStayPosition() will get the proper coords.
pet->ReplaceAllDynamicFlags(UNIT_DYNFLAG_NONE);
pet->RemoveUnitFlag(UNIT_FLAG_SKINNABLE);
pet->setDeathState(ALIVE);
pet->setDeathState(DeathState::Alive);
pet->ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~(UNIT_STATE_POSSESSED))); // xinef: just in case
pet->SetHealth(pet->CountPctFromMaxHealth(damage));
pet->SetDisplayId(pet->GetNativeDisplayId());