mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[10695] Cleanup some death state enums usage.
This commit is contained in:
parent
bb3663d94f
commit
d2b3981631
5 changed files with 20 additions and 18 deletions
|
|
@ -557,7 +557,7 @@ void Creature::Update(uint32 update_diff, uint32 tick_diff)
|
|||
m_regenTimer = REGEN_TIME_FULL;
|
||||
break;
|
||||
}
|
||||
case DEAD_FALLING:
|
||||
case CORPSE_FALLING:
|
||||
{
|
||||
SetDeathState(CORPSE);
|
||||
}
|
||||
|
|
@ -1396,7 +1396,7 @@ void Creature::SetDeathState(DeathState s)
|
|||
UpdateSpeed(MOVE_RUN, false);
|
||||
}
|
||||
|
||||
// return, since we promote to DEAD_FALLING. DEAD_FALLING is promoted to CORPSE at next update.
|
||||
// return, since we promote to CORPSE_FALLING. CORPSE_FALLING is promoted to CORPSE at next update.
|
||||
if (CanFly() && FallGround())
|
||||
return;
|
||||
|
||||
|
|
@ -1422,7 +1422,7 @@ void Creature::SetDeathState(DeathState s)
|
|||
|
||||
bool Creature::FallGround()
|
||||
{
|
||||
// Only if state is JUST_DIED. DEAD_FALLING is set below and promoted to CORPSE later
|
||||
// Only if state is JUST_DIED. CORPSE_FALLING is set below and promoted to CORPSE later
|
||||
if (getDeathState() != JUST_DIED)
|
||||
return false;
|
||||
|
||||
|
|
@ -1439,7 +1439,7 @@ bool Creature::FallGround()
|
|||
if (fabs(GetPositionZ() - tz) < 0.1f)
|
||||
return false;
|
||||
|
||||
Unit::SetDeathState(DEAD_FALLING);
|
||||
Unit::SetDeathState(CORPSE_FALLING);
|
||||
|
||||
float dz = tz - GetPositionZ();
|
||||
float distance = sqrt(dz*dz);
|
||||
|
|
@ -1474,7 +1474,7 @@ void Creature::Respawn()
|
|||
SetVisibility(currentVis); // restore visibility state
|
||||
UpdateObjectVisibility();
|
||||
|
||||
if(getDeathState() == DEAD)
|
||||
if (IsDespawned())
|
||||
{
|
||||
if (m_DBTableGuid)
|
||||
sObjectMgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(), 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue