Use an integer when waiting

Since the expected time is in milliseconds, it's best to use an integer instead. Floating-point numbers lose precision as they get larger, especially when the level's current time is long (e.g., over 24 hours). This loss of precision could cause scripts to wait unsuccessfully with small numbers, causing unexpected behaviors
This commit is contained in:
smallmodel committed 2024-12-13 22:17:43 +01:00
1 parent 32bee2602c
commit acf2dd0ad1
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -2478,7 +2478,7 @@ void ScriptThread::Stop(void)
}
}
void ScriptThread::Wait(float time)
void ScriptThread::Wait(int time)
{
StartTiming(level.inttime + time);
m_ScriptVM->Suspend();