# HG changeset patch # User unc0rr # Date 1170703256 0 # Node ID 25be13ae29da827a3870e9d18882d95773dd77a7 # Parent e7565bb852a20b00ad33246781a13e685d77e26a - Fix getting negative coordinates of cursor - Fix some warnings diff -r e7565bb852a2 -r 25be13ae29da hedgewars/uGears.pas --- a/hedgewars/uGears.pas Sun Feb 04 22:26:13 2007 +0000 +++ b/hedgewars/uGears.pas Mon Feb 05 19:20:56 2007 +0000 @@ -831,12 +831,13 @@ y, sy: LongInt; ar: array[0..511] of TPoint; ar2: array[0..1023] of TPoint; - cnt, cnt2, delta: Longword; + cnt, cnt2: Longword; + delta: LongInt; begin delta:= 250; cnt2:= 0; repeat - x:= Left + GetRandom(Delta); + x:= Left + LongInt(GetRandom(Delta)); repeat inc(x, Delta); cnt:= 0; diff -r e7565bb852a2 -r 25be13ae29da hedgewars/uIO.pas --- a/hedgewars/uIO.pas Sun Feb 04 22:26:13 2007 +0000 +++ b/hedgewars/uIO.pas Mon Feb 05 19:20:56 2007 +0000 @@ -207,13 +207,13 @@ {$IFDEF DEBUGFILE}AddFileLog('got cmd "N": time '+inttostr(extcmd[cmdcurpos].Time)){$ENDIF} end; 'p': begin - TargetPoint.X:= SDLNet_Read16(@extcmd[cmdcurpos].X); - TargetPoint.Y:= SDLNet_Read16(@extcmd[cmdcurpos].Y); + TargetPoint.X:= SmallInt(SDLNet_Read16(@extcmd[cmdcurpos].X)); + TargetPoint.Y:= SmallInt(SDLNet_Read16(@extcmd[cmdcurpos].Y)); ParseCommand('put', true) end; 'P': begin - CursorPoint.X:= SDLNet_Read16(@extcmd[cmdcurpos].X) + WorldDx; - CursorPoint.Y:= SDLNet_Read16(@extcmd[cmdcurpos].Y) + WorldDy; + CursorPoint.X:= SmallInt(SDLNet_Read16(@extcmd[cmdcurpos].X) + WorldDx); + CursorPoint.Y:= SmallInt(SDLNet_Read16(@extcmd[cmdcurpos].Y) + WorldDy); end; '1'..'5': ParseCommand('timer ' + extcmd[cmdcurpos].cmd, true); #128..char(128 + cMaxSlotIndex): ParseCommand('slot ' + char(byte(extcmd[cmdcurpos].cmd) - 79), true)