Core/Creature: Fixed ForcedDespawn

By Malcrom
This commit is contained in:
Aokromes
2017-04-14 17:50:14 +02:00
parent 08bc1849ba
commit f1aeff5390

View File

@@ -1816,22 +1816,27 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn, Seconds const& forceRespawn
return;
}
if (IsAlive())
if (forceRespawnTimer > Seconds::zero())
{
if (forceRespawnTimer > Seconds::zero())
if (IsAlive())
{
uint32 respawnDelay = m_respawnDelay;
uint32 corpseDelay = m_corpseDelay;
m_respawnDelay = forceRespawnTimer.count();
m_corpseDelay = 0;
setDeathState(JUST_DIED);
m_respawnDelay = respawnDelay;
m_corpseDelay = corpseDelay;
}
else
setDeathState(JUST_DIED);
{
m_corpseRemoveTime = time(NULL);
m_respawnTime = time(NULL) + forceRespawnTimer.count();
}
}
else
if (IsAlive())
setDeathState(JUST_DIED);
RemoveCorpse(false);
}