Core/GameObject: Fix an edge case where GOs might never respawn after being manually despawned.

Port From (https://github.com/TrinityCore/TrinityCore/commit/eb7a8584e227b7cbd68c051c044f08c47019586b)
This commit is contained in:
hondacrx
2021-10-14 19:47:15 -04:00
parent be1afd7949
commit 5e1494e4b4
@@ -435,7 +435,10 @@ namespace Game.Entities
if (m_despawnDelay > diff)
m_despawnDelay -= diff;
else
{
m_despawnDelay = 0;
DespawnOrUnsummon(TimeSpan.FromMilliseconds(0), m_despawnRespawnTime);
}
}
switch (m_lootState)
@@ -896,9 +899,11 @@ namespace Game.Entities
}
else
{
uint respawnDelay = (uint)((forceRespawnTime > TimeSpan.Zero) ? forceRespawnTime.TotalSeconds : m_respawnDelayTime);
if (m_goData != null && respawnDelay != 0)
if (m_goData != null)
{
uint respawnDelay = (uint)((forceRespawnTime > TimeSpan.Zero) ? forceRespawnTime.TotalSeconds : m_respawnDelayTime);
SaveRespawnTime(respawnDelay);
}
Delete();
}
}