# HG changeset patch # User unc0rr # Date 1255376387 0 # Node ID 5faa05d9924192dbc030ff0031217713882bc460 # Parent 332287d62c81a9eb4e1737bf99679a794d0708b5 Smaxx: less hacks diff -r 332287d62c81 -r 5faa05d99241 hedgewars/HHHandlers.inc --- a/hedgewars/HHHandlers.inc Mon Oct 12 19:33:21 2009 +0000 +++ b/hedgewars/HHHandlers.inc Mon Oct 12 19:39:47 2009 +0000 @@ -43,14 +43,14 @@ inc(i); TryDo(i < 2, 'Engine bug: no ammo in current slot', true) end; - until (Ammo^[slot, CurAmmo].Count > 0) and ((Team^.Clan^.TurnNumber > Ammoz[Ammo^[slot, CurAmmo].AmmoType].SkipTurns) or ((TrainingFlags and tfIgnoreDelays) <> 0)) + until (Ammo^[slot, CurAmmo].Count > 0) and (Team^.Clan^.TurnNumber > Ammoz[Ammo^[slot, CurAmmo].AmmoType].SkipTurns) end else begin i:= 0; // check whether there is ammo in slot while (i <= cMaxSlotAmmoIndex) and ((Ammo^[slot, i].Count = 0) - or ((Team^.Clan^.TurnNumber <= Ammoz[Ammo^[slot, i].AmmoType].SkipTurns) and ((TrainingFlags and tfIgnoreDelays) = 0))) do inc(i); + or (Team^.Clan^.TurnNumber <= Ammoz[Ammo^[slot, i].AmmoType].SkipTurns)) do inc(i); if i <= cMaxSlotAmmoIndex then begin @@ -67,7 +67,7 @@ begin weap:= TAmmoType(Gear^.MsgParam); -if (PHedgehog(Gear^.Hedgehog)^.Team^.Clan^.TurnNumber <= Ammoz[weap].SkipTurns) and ((TrainingFlags and tfIgnoreDelays) = 0) then exit; // weapon is not activated yet +if PHedgehog(Gear^.Hedgehog)^.Team^.Clan^.TurnNumber <= Ammoz[weap].SkipTurns then exit; // weapon is not activated yet Gear^.MsgParam:= Ammoz[weap].Slot; diff -r 332287d62c81 -r 5faa05d99241 hedgewars/uAmmos.pas --- a/hedgewars/uAmmos.pas Mon Oct 12 19:33:21 2009 +0000 +++ b/hedgewars/uAmmos.pas Mon Oct 12 19:39:47 2009 +0000 @@ -75,6 +75,7 @@ if a <> amNothing then begin Ammoz[a].Probability:= probability[byte(s[ord(a) + ord(High(TAmmoType))]) - byte('0')]; + if (TrainingFlags and tfIgnoreDelays) <> 0 then Ammoz[a].SkipTurns:= 0; cnt:= byte(s[ord(a)]) - byte('0'); // avoid things we already have infinite number if cnt = 9 then diff -r 332287d62c81 -r 5faa05d99241 hedgewars/uWorld.pas --- a/hedgewars/uWorld.pas Mon Oct 12 19:33:21 2009 +0000 +++ b/hedgewars/uWorld.pas Mon Oct 12 19:39:47 2009 +0000 @@ -138,8 +138,6 @@ begin l:= Ammoz[Ammo^[i, t].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber; - if (TrainingFlags and tfIgnoreDelays) <> 0 then l:= -1; - if l >= 0 then begin DrawSprite(sprAMAmmosBW, x + g * 33 + 35, y + 1, LongInt(Ammo^[i, t].AmmoType)-1); @@ -170,7 +168,7 @@ if Ammo^[Slot, Pos].Count < AMMO_INFINITE then DrawTexture(cScreenWidth div 2 + AMxShift - 35, cScreenHeight - 68, CountTexz[Ammo^[Slot, Pos].Count]); - if bSelected and (((TrainingFlags and tfIgnoreDelays) <> 0) or (Ammoz[Ammo^[Slot, Pos].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber < 0)) then + if bSelected and (Ammoz[Ammo^[Slot, Pos].AmmoType].SkipTurns - CurrentTeam^.Clan^.TurnNumber < 0) then begin bShowAmmoMenu:= false; SetWeapon(Ammo^[Slot, Pos].AmmoType);