# HG changeset patch # User nemo # Date 1252461337 0 # Node ID d4d545da9dbe4556975a2dd676376fa43ecdde15 # Parent 76d853f22afabf480f9a14e6ef632c847aa220cd Ok. This time I think I have it. amNothing should work. diff -r 76d853f22afa -r d4d545da9dbe hedgewars/uAmmos.pas --- a/hedgewars/uAmmos.pas Tue Sep 08 21:58:09 2009 +0000 +++ b/hedgewars/uAmmos.pas Wed Sep 09 01:55:37 2009 +0000 @@ -107,7 +107,8 @@ end end; ammos[a]:= cnt - end + end else + ammos[a]:= AMMO_INFINITE end; FillAmmoStore(StoresList[Pred(StoreCnt)], ammos) diff -r 76d853f22afa -r d4d545da9dbe hedgewars/uConsts.pas --- a/hedgewars/uConsts.pas Tue Sep 08 21:58:09 2009 +0000 +++ b/hedgewars/uConsts.pas Wed Sep 09 01:55:37 2009 +0000 @@ -844,7 +844,6 @@ NumberInCase: 3; Ammo: (Propz: ammoprop_ForwMsgs or ammoprop_AttackInMove or - ammoprop_DontHold or ammoprop_AltAttack; Count: 5; NumPerTurn: 0; diff -r 76d853f22afa -r d4d545da9dbe hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Tue Sep 08 21:58:09 2009 +0000 +++ b/hedgewars/uWorld.pas Wed Sep 09 01:55:37 2009 +0000 @@ -80,7 +80,7 @@ procedure ShowAmmoMenu; const MENUSPEED = 15; -var x, y, i, t, l: LongInt; +var x, y, i, t, l, g: LongInt; Slot, Pos: LongInt; begin if (TurnTimeLeft = 0) or (((CurAmmoGear = nil) or ((CurAmmoGear^.Ammo^.Propz and ammoprop_AltAttack) = 0)) and KbdKeyPressed) then bShowAmmoMenu:= false; @@ -131,25 +131,30 @@ DrawSprite(sprAMSlot, x, y, 0); DrawSprite(sprAMSlotKeys, x + 2, y + 1, i); t:= 0; - while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) and (Ammo^[i, t].AmmoType <> amNothing) do + g:= 0; + while (t <= cMaxSlotAmmoIndex) and (Ammo^[i, t].Count > 0) do begin - l:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber; + if (Ammo^[i, t].AmmoType <> amNothing) then + begin + l:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber; - if l >= 0 then - begin - DrawSprite(sprAMAmmosBW, x + t * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); - DrawSprite(sprTurnsLeft, x + t * 33 + 51, y + 17, l); - end else - DrawSprite(sprAMAmmos, x + t * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); + if l >= 0 then + begin + DrawSprite(sprAMAmmosBW, x + g * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); + DrawSprite(sprTurnsLeft, x + g * 33 + 51, y + 17, l); + end else + DrawSprite(sprAMAmmos, x + g * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); - if (Slot = i) - and (CursorPoint.X >= x + t * 33 + 35) - and (CursorPoint.X < x + t * 33 + 68) then - begin - if (l < 0) then DrawSprite(sprAMSelection, x + t * 33 + 35, y + 1, 0); - Pos:= t; - end; - inc(t) + if (Slot = i) + and (CursorPoint.X >= x + g * 33 + 35) + and (CursorPoint.X < x + g * 33 + 68) then + begin + if (l < 0) then DrawSprite(sprAMSelection, x + g * 33 + 35, y + 1, 0); + Pos:= t; + end; + inc(g) + end; + inc(t) end end; dec(y, 1);