hedgewars/HHHandlers.inc
changeset 3951 c9a63db3e603
parent 3949 4c4c0a2507cc
child 3953 fd7ced2071a1
--- a/hedgewars/HHHandlers.inc	Sun Oct 10 16:51:40 2010 -0400
+++ b/hedgewars/HHHandlers.inc	Sun Oct 10 20:16:17 2010 -0400
@@ -69,11 +69,12 @@
         inc(ammoidx);
         if (ammoidx > cMaxSlotAmmoIndex) then
             begin
-            ammoidx:= 0;
             inc(i);
-            TryDo(i < 2, 'Engine bug: no ammo in current slot', true)
+            CurAmmoType:= amNothing;
+            ammoidx:= -1;
+            //TryDo(i < 2, 'Engine bug: no ammo in current slot', true)
             end;
-        until (Ammo^[slot, ammoidx].Count > 0) and (Team^.Clan^.TurnNumber > Ammoz[Ammo^[slot, ammoidx].AmmoType].SkipTurns)
+        until ((Ammo^[slot, ammoidx].Count > 0) and (Team^.Clan^.TurnNumber > Ammoz[Ammo^[slot, ammoidx].AmmoType].SkipTurns)) or (i = 1)
         end 
     else
         begin