Core/Creatures: Fixed an arithmetic error in respawn code

Creatures should now respawn correctly in their correct time.
Issue was caused by single-precision floating-point format losing precision on lower digits with high numbers, for reference http://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html
Closes #12428
This commit is contained in:
jackpoz
2014-08-19 00:00:54 +02:00
parent a60c902b45
commit 4a3416627d

View File

@@ -2277,7 +2277,7 @@ void Creature::AllLootRemovedFromCorpse()
if (loot.loot_type == LOOT_SKINNING)
m_corpseRemoveTime = now;
else
m_corpseRemoveTime = now + m_corpseDelay * decayRate;
m_corpseRemoveTime = now + uint32(m_corpseDelay * decayRate);
m_respawnTime = m_corpseRemoveTime + m_respawnDelay;
}