hedgewars/HHHandlers.inc
changeset 3842 fc94291ca1d9
parent 3837 47a623d9cdaa
child 3851 fbe2e9722fc9
--- a/hedgewars/HHHandlers.inc	Tue Sep 07 22:28:33 2010 -0400
+++ b/hedgewars/HHHandlers.inc	Wed Sep 08 17:34:18 2010 -0400
@@ -43,7 +43,6 @@
 // Shouldn't more of this ammo switching stuff be moved to uAmmos ?
 procedure ChangeAmmo(Gear: PGear);
 var slot, ammoidx, i: Longword;
-    CurWeapon: PAmmo;
 begin
 slot:= Gear^.MsgParam;
 
@@ -52,13 +51,12 @@
     Gear^.Message:= Gear^.Message and not gm_Slot;
     ammoidx:= 0;
     while (ammoidx < cMaxSlotAmmoIndex) and (Ammo^[slot, ammoidx].AmmoType <> CurAmmoType) do inc(ammoidx);
-    CurWeapon:= @Ammo^[slot, ammoidx];
 
     if ((Gear^.State and (gstAttacking or gstAttacked)) <> 0) or
-       ((MultiShootAttacks > 0) and ((CurWeapon^.Propz and ammoprop_NoRoundEndHint) = 0)) or
+       ((MultiShootAttacks > 0) and (CurAmmoGear <> nil) and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoRoundEndHint) = 0)) or
        ((Gear^.State and gstHHDriven) = 0) then exit;
 
-    if ((CurWeapon^.Propz and ammoprop_NoRoundEndHint) <> 0) and (MultiShootAttacks > 0) then OnUsedAmmo(PHedgehog(Gear^.Hedgehog)^);
+    if ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEndHint) <> 0) and (MultiShootAttacks > 0) then OnUsedAmmo(PHedgehog(Gear^.Hedgehog)^);
 
     MultiShootAttacks:= 0;
     Gear^.Message:= Gear^.Message and not (gm_LJump or gm_HJump);
@@ -774,7 +772,8 @@
             end;
 
 if (CurAmmoGear = nil)
-    or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) then
+    or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0) 
+    or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_NoRoundEndHint) <> 0) then
     begin
     if ((Gear^.Message and gm_Slot) <> 0) then
         begin