diff --git a/zone/mob_movement_manager.cpp b/zone/mob_movement_manager.cpp index 746d85779..bf73ba750 100644 --- a/zone/mob_movement_manager.cpp +++ b/zone/mob_movement_manager.cpp @@ -933,16 +933,11 @@ void MobMovementManager::SendCommandToClients( float MobMovementManager::FixHeading(float in) { - auto h = in; - while (h > 512.0) { - h -= 512.0; + int h = static_cast(in) % 512; + if (h < 0) { + h += 512; } - - while (h < 0.0) { - h += 512.0; - } - - return h; + return static_cast(h); } void MobMovementManager::DumpStats(Client *client)