1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-21 16:55:01 -05:00

PascalScript: Fix Wait() with negative values.

This commit is contained in:
Merlijn Wajer 2011-01-09 15:12:42 +01:00
parent a52b164f34
commit d75f7d55cf

View File

@ -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;