mirror of
https://github.com/moparisthebest/Simba
synced 2024-11-21 08:45:06 -05:00
PascalScript: Fix Wait() with negative values.
This commit is contained in:
parent
a52b164f34
commit
d75f7d55cf
@ -40,12 +40,18 @@ end;
|
||||
procedure ps_Wait(t: Integer); extdecl;
|
||||
{$ifdef MSWINDOWS}
|
||||
begin
|
||||
Sleep(t);
|
||||
if t < 0 then
|
||||
raise Exception.CreateFmt('The given wait time ([%d]) is invalid.',[t])
|
||||
else
|
||||
Sleep(t);
|
||||
end;
|
||||
{$else}
|
||||
var
|
||||
EndTime : DWord;
|
||||
begin
|
||||
if t < 0 then
|
||||
raise Exception.CreateFmt('The given wait time ([%d]) is invalid.',[t]);
|
||||
|
||||
if t > 50 then
|
||||
begin;
|
||||
EndTime := GetTickCount + t;
|
||||
|
Loading…
Reference in New Issue
Block a user