[Fix] FixHeading Infinite Loop Fix (#4854)

Co-authored-by: KimLS <KimLS@peqtgc.com>
This commit is contained in:
AlexandKimLS authored and GitHub committed 2025-04-09 20:55:35 -05:00
1 parent cc30c72538
commit f9fe4ea2ec
1 file changed
+4 -9
+4 -9
View File
@@ -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<int>(in) % 512;
if (h < 0) {
h += 512;
}
while (h < 0.0) {
h += 512.0;
}
return h;
return static_cast<float>(h);
}
void MobMovementManager::DumpStats(Client *client)