Fix use of slot 8 and avoid such bug in future
authorunc0rr
Wed, 16 Aug 2006 21:35:27 +0000
changeset 112 ca5f06017e99
parent 111 30ca06092a64
child 113 d975a426ebf7
Fix use of slot 8 and avoid such bug in future
hedgewars/uConsts.pas
hedgewars/uIO.pas
--- a/hedgewars/uConsts.pas	Wed Aug 16 11:41:00 2006 +0000
+++ b/hedgewars/uConsts.pas	Wed Aug 16 21:35:27 2006 +0000
@@ -270,7 +270,7 @@
       Ammoz: array [TAmmoType] of record
                                   NameId: TAmmoStrId;
                                   Ammo: TAmmo;
-                                  Slot: Longword;
+                                  Slot: 0..cMaxSlotIndex;
                                   TimeAfterTurn: Longword;
                                   end = (
                                   (NameId: sidGrenade;
--- a/hedgewars/uIO.pas	Wed Aug 16 11:41:00 2006 +0000
+++ b/hedgewars/uIO.pas	Wed Aug 16 21:35:27 2006 +0000
@@ -204,7 +204,7 @@
              CursorPoint.Y:= extcmd[cmdcurpos].Y + WorldDy;
              end;
         '1'..'5': ParseCommand('timer ' + extcmd[cmdcurpos].cmd);
-        #128..#134: ParseCommand('slot ' + char(byte(extcmd[cmdcurpos].cmd) - 79))
+        #128..char(128 + cMaxSlotIndex): ParseCommand('slot ' + char(byte(extcmd[cmdcurpos].cmd) - 79))
         end;
    inc(cmdcurpos)
    end;