Skip to content

Commit f1aeff5

Browse files
committed
Core/Creature: Fixed ForcedDespawn
By Malcrom
1 parent 08bc184 commit f1aeff5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/server/game/Entities/Creature/Creature.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,22 +1816,27 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn, Seconds const& forceRespawn
18161816
return;
18171817
}
18181818

1819-
if (IsAlive())
1819+
if (forceRespawnTimer > Seconds::zero())
18201820
{
1821-
if (forceRespawnTimer > Seconds::zero())
1821+
if (IsAlive())
18221822
{
18231823
uint32 respawnDelay = m_respawnDelay;
18241824
uint32 corpseDelay = m_corpseDelay;
18251825
m_respawnDelay = forceRespawnTimer.count();
18261826
m_corpseDelay = 0;
18271827
setDeathState(JUST_DIED);
1828-
18291828
m_respawnDelay = respawnDelay;
18301829
m_corpseDelay = corpseDelay;
18311830
}
18321831
else
1833-
setDeathState(JUST_DIED);
1832+
{
1833+
m_corpseRemoveTime = time(NULL);
1834+
m_respawnTime = time(NULL) + forceRespawnTimer.count();
1835+
}
18341836
}
1837+
else
1838+
if (IsAlive())
1839+
setDeathState(JUST_DIED);
18351840

18361841
RemoveCorpse(false);
18371842
}

0 commit comments

Comments
 (0)