mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 19:06:49 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user