# HG changeset patch # User nemo # Date 1265633169 0 # Node ID 2613de505d8dbd96e30e0f357fdc054821c7994b # Parent f21d3ca74ef200df3fb41e9b07cdaf06eb4d59e3 Allow for ammos w/o teleports diff -r f21d3ca74ef2 -r 2613de505d8d hedgewars/uAmmos.pas --- a/hedgewars/uAmmos.pas Mon Feb 08 05:17:59 2010 +0000 +++ b/hedgewars/uAmmos.pas Mon Feb 08 12:46:09 2010 +0000 @@ -54,6 +54,7 @@ FillChar(mi, sizeof(mi), 0); FillChar(Ammo^, sizeof(Ammo^), 0); for a:= Low(TAmmoType) to High(TAmmoType) do + begin if cnts[a] > 0 then begin TryDo(mi[Ammoz[a].Slot] <= cMaxSlotAmmoIndex, 'Ammo slot overflow', true); @@ -63,9 +64,22 @@ Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]].InitialCount:= cnts[a]; if ((GameFlags and gfPlaceHog) <> 0) and (a = amTeleport) then - Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]].Count:= AMMO_INFINITE; + Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]].Count:= AMMO_INFINITE; inc(mi[Ammoz[a].Slot]) end + else if ((GameFlags and gfPlaceHog) <> 0) and (a = amTeleport) then + begin + TryDo(mi[Ammoz[a].Slot] <= cMaxSlotAmmoIndex, 'Ammo slot overflow', true); + Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]]:= Ammoz[a].Ammo; + + Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]].Count:= 0; + Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]].InitialCount:= 0; + + if ((GameFlags and gfPlaceHog) <> 0) and (a = amTeleport) then + Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]].Count:= AMMO_INFINITE; + inc(mi[Ammoz[a].Slot]) + end + end end; procedure AddAmmoStore(s: shortstring);