- Fix getting negative coordinates of cursor
authorunc0rr
Mon, 05 Feb 2007 19:20:56 +0000
changeset 392 25be13ae29da
parent 391 e7565bb852a2
child 393 db01cc79f278
- Fix getting negative coordinates of cursor - Fix some warnings
hedgewars/uGears.pas
hedgewars/uIO.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;
--- 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)