# HG changeset patch
# User nemo
# Date 1286813586 14400
# Node ID ada50f8d4186d9efcc25420ba419dd92ef3e6024
# Parent  e7ea30323993ec95374e7438fdfe9234df11c7e9
Remove bit of debug code from prior, don't switch weapons on end of turn (stick with whatever the last weapon was)

diff -r e7ea30323993 -r ada50f8d4186 hedgewars/uAmmos.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;
diff -r e7ea30323993 -r ada50f8d4186 hedgewars/uTeams.pas
--- 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