1
0
mirror of https://github.com/moparisthebest/Simba synced 2025-02-16 07:10:10 -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; procedure ps_Wait(t: Integer); extdecl;
{$ifdef MSWINDOWS} {$ifdef MSWINDOWS}
begin begin
if t < 0 then
raise Exception.CreateFmt('The given wait time ([%d]) is invalid.',[t])
else
Sleep(t); Sleep(t);
end; end;
{$else} {$else}
var var
EndTime : DWord; EndTime : DWord;
begin begin
if t < 0 then
raise Exception.CreateFmt('The given wait time ([%d]) is invalid.',[t]);
if t > 50 then if t > 50 then
begin; begin;
EndTime := GetTickCount + t; EndTime := GetTickCount + t;