mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
refactor(Core/Misc): Make DeathState enum class (#17607)
This commit is contained in:
@@ -1010,7 +1010,7 @@ void Player::setDeathState(DeathState s, bool /*despawn = false*/)
|
||||
|
||||
bool cur = IsAlive();
|
||||
|
||||
if (s == JUST_DIED)
|
||||
if (s == DeathState::JustDied)
|
||||
{
|
||||
if (!cur)
|
||||
{
|
||||
@@ -1025,7 +1025,7 @@ void Player::setDeathState(DeathState s, bool /*despawn = false*/)
|
||||
|
||||
clearResurrectRequestData();
|
||||
|
||||
//FIXME: is pet dismissed at dying or releasing spirit? if second, add setDeathState(DEAD) to HandleRepopRequestOpcode and define pet unsummon here with (s == DEAD)
|
||||
//FIXME: is pet dismissed at dying or releasing spirit? if second, add setDeathState(DeathState::Dead) to HandleRepopRequestOpcode and define pet unsummon here with (s == DEAD)
|
||||
RemovePet(nullptr, PET_SAVE_NOT_IN_SLOT, true);
|
||||
|
||||
// save value before aura remove in Unit::setDeathState
|
||||
@@ -1045,7 +1045,7 @@ void Player::setDeathState(DeathState s, bool /*despawn = false*/)
|
||||
ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH, 0);
|
||||
}
|
||||
// xinef: enable passive area auras!
|
||||
else if (s == ALIVE)
|
||||
else if (s == DeathState::Alive)
|
||||
ClearUnitState(UNIT_STATE_ISOLATED);
|
||||
|
||||
Unit::setDeathState(s);
|
||||
@@ -1054,7 +1054,7 @@ void Player::setDeathState(DeathState s, bool /*despawn = false*/)
|
||||
ArenaSpectator::SendCommand_UInt32Value(FindMap(), GetGUID(), "STA", IsAlive() ? 1 : 0);
|
||||
|
||||
// restore resurrection spell id for player after aura remove
|
||||
if (s == JUST_DIED && cur && ressSpellId)
|
||||
if (s == DeathState::JustDied && cur && ressSpellId)
|
||||
SetUInt32Value(PLAYER_SELF_RES_SPELL, ressSpellId);
|
||||
|
||||
if (IsAlive() && !cur)
|
||||
@@ -4396,7 +4396,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
|
||||
if (GetSession()->IsARecruiter() || (GetSession()->GetRecruiterId() != 0))
|
||||
SetDynamicFlag(UNIT_DYNFLAG_REFER_A_FRIEND);
|
||||
|
||||
setDeathState(ALIVE);
|
||||
setDeathState(DeathState::Alive);
|
||||
SetMovement(MOVE_LAND_WALK);
|
||||
SetMovement(MOVE_UNROOT);
|
||||
SetWaterWalking(false);
|
||||
@@ -4463,7 +4463,7 @@ void Player::KillPlayer()
|
||||
|
||||
StopMirrorTimers(); //disable timers(bars)
|
||||
|
||||
setDeathState(CORPSE);
|
||||
setDeathState(DeathState::Corpse);
|
||||
//SetUnitFlag(UNIT_FLAG_NOT_IN_PVP);
|
||||
|
||||
ReplaceAllDynamicFlags(UNIT_DYNFLAG_NONE);
|
||||
|
||||
Reference in New Issue
Block a user