# HG changeset patch # User nemo # Date 1289849998 18000 # Node ID 23ab3bdbf218b791de24dd04800117c726a7d553 # Parent 46b8791e577f04110fa516e5987caf1afa0ade4e This should fix Chip's bug with unlimited teleports. Also remove more hog placement special behaviour and just use ResetWeapons with a check against PlacingHogs mode diff -r 46b8791e577f -r 23ab3bdbf218 hedgewars/uAmmos.pas --- a/hedgewars/uAmmos.pas Mon Nov 15 04:30:11 2010 +0100 +++ b/hedgewars/uAmmos.pas Mon Nov 15 14:39:58 2010 -0500 @@ -68,20 +68,7 @@ begin TryDo(mi[Ammoz[a].Slot] <= cMaxSlotAmmoIndex, 'Ammo slot overflow', true); Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]]:= Ammoz[a].Ammo; - with Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]] do - begin - Count:= cnts[a]; - if (TotalRounds < 0) and ((GameFlags and gfPlaceHog) <> 0) and (a = amTeleport) then Count:= AMMO_INFINITE; - end; - inc(mi[Ammoz[a].Slot]) - end - else if (TotalRounds < 0) and ((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:= AMMO_INFINITE; - + with Ammo^[Ammoz[a].Slot, mi[Ammoz[a].Slot]] do Count:= cnts[a]; inc(mi[Ammoz[a].Slot]) end end @@ -134,10 +121,14 @@ if ((GameFlags and gfPlaceHog) <> 0) and (a <> amTeleport) and (a <> amSkip) and - (Ammoz[a].SkipTurns < 10000) then inc(Ammoz[a].SkipTurns,10000) + (Ammoz[a].SkipTurns < 10000) then inc(Ammoz[a].SkipTurns,10000); + if ((GameFlags and gfPlaceHog) <> 0) and (a = amTeleport) then ammos[a]:= AMMO_INFINITE end else ammos[a]:= AMMO_INFINITE; - InitialCounts[Pred(StoreCnt)][a]:= ammos[a]; + if ((GameFlags and gfPlaceHog) <> 0) and (a = amTeleport) then + InitialCounts[Pred(StoreCnt)][a]:= cnt + else + InitialCounts[Pred(StoreCnt)][a]:= ammos[a]; end; FillAmmoStore(StoresList[Pred(StoreCnt)], ammos) end; diff -r 46b8791e577f -r 23ab3bdbf218 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Mon Nov 15 04:30:11 2010 +0100 +++ b/hedgewars/uGears.pas Mon Nov 15 14:39:58 2010 -0500 @@ -993,7 +993,7 @@ t:= t^.NextGear end; - if (GameFlags and gfResetWeps) <> 0 then + if ((GameFlags and gfResetWeps) <> 0) and not PlacingHogs then ResetWeapons; if (GameFlags and gfResetHealth) <> 0 then diff -r 46b8791e577f -r 23ab3bdbf218 misc/hedgewars.png Binary file misc/hedgewars.png has changed