hedgewars/uAmmos.pas
changeset 5316 191cd6c06203
parent 5273 102728b20c4d
child 5345 3c5480e91951
--- a/hedgewars/uAmmos.pas	Sun Jun 26 02:47:36 2011 +0200
+++ b/hedgewars/uAmmos.pas	Sun Jun 26 13:38:47 2011 -0400
@@ -191,6 +191,7 @@
 var ammos: TAmmoCounts;
     slot, ami: LongInt;
     hhammo: PHHAmmo;
+    CurWeapon: PAmmo;
 begin
 {$HINTS OFF}
 FillChar(ammos, sizeof(ammos), 0);
@@ -205,7 +206,17 @@
 ammos[ammo]:= cnt;
 if ammos[ammo] > AMMO_INFINITE then ammos[ammo]:= AMMO_INFINITE;
 
-FillAmmoStore(hhammo, ammos)
+FillAmmoStore(hhammo, ammos);
+CurWeapon:= GetAmmoEntry(Hedgehog);
+with Hedgehog do
+    begin
+    with CurWeapon^ do
+        if Count = 0 then
+            begin
+            PackAmmo(Ammo, Ammoz[AmmoType].Slot);
+            CurAmmoType:= amNothing
+            end
+    end
 end;
 
 procedure PackAmmo(Ammo: PHHAmmo; Slot: LongInt);