Remove bit of debug code from prior, don't switch weapons on end of turn (stick with whatever the last weapon was)
authornemo
Mon, 11 Oct 2010 12:13:06 -0400
changeset 3960 ada50f8d4186
parent 3959 e7ea30323993
child 3961 cf0ca1ff6c1a
Remove bit of debug code from prior, don't switch weapons on end of turn (stick with whatever the last weapon was)
hedgewars/uAmmos.pas
hedgewars/uTeams.pas
--- a/hedgewars/uAmmos.pas	Mon Oct 11 11:36:47 2010 -0400
+++ b/hedgewars/uAmmos.pas	Mon Oct 11 12:13:06 2010 -0400
@@ -147,9 +147,7 @@
     else ammos[a]:= AMMO_INFINITE;
     InitialCounts[Pred(StoreCnt)][a]:= ammos[a];
     end;
-FillAmmoStore(StoresList[Pred(StoreCnt)], ammos);
-for cnt:= 0 to cMaxSlotIndex do
-    PackAmmo(StoresList[Pred(StoreCnt)], cnt)
+FillAmmoStore(StoresList[Pred(StoreCnt)], ammos)
 end;
 
 function GetAmmoByNum(num: Longword): PHHAmmo;
--- a/hedgewars/uTeams.pas	Mon Oct 11 11:36:47 2010 -0400
+++ b/hedgewars/uTeams.pas	Mon Oct 11 12:13:06 2010 -0400
@@ -231,6 +231,8 @@
 procedure AfterSwitchHedgehog;
 var g: PGear;
     i, t: LongInt;
+    CurWeapon: PAmmo;
+
 begin
 if PlacingHogs then
    begin
@@ -250,7 +252,8 @@
 
 inc(CurrentTeam^.Clan^.TurnNumber);
 
-SwitchNotHeldAmmo(CurrentHedgehog^);
+CurWeapon:= GetAmmoEntry(CurrentHedgehog^);
+if CurWeapon^.Count = 0 then CurrentHedgehog^.CurAmmoType:= amNothing;
 
 with CurrentHedgehog^ do
     begin