Call OnUsedAmmo *after* doing the normal CurAmmoType stuff so CurAmmoType actually points to the right bloody weapon
authornemo
Mon, 11 Oct 2010 14:55:13 -0400
changeset 3965 09eea558ba83
parent 3964 6aadae28b3df
child 3966 cbec77b5f706
Call OnUsedAmmo *after* doing the normal CurAmmoType stuff so CurAmmoType actually points to the right bloody weapon
hedgewars/GSHandlers.inc
hedgewars/HHHandlers.inc
--- a/hedgewars/GSHandlers.inc	Mon Oct 11 20:47:17 2010 +0200
+++ b/hedgewars/GSHandlers.inc	Mon Oct 11 14:55:13 2010 -0400
@@ -3092,8 +3092,7 @@
 
     HHGear := PHedgehog(Gear^.Hedgehog)^.Gear;
     FollowGear := HHGear;
-    OnUsedAmmo(PHedgehog(Gear^.Hedgehog)^);
-    ApplyAmmoChanges(PHedgehog(Gear^.Hedgehog)^);
+    AfterAttack;
     with HHGear^ do
     begin
         State := State and not gstAttacking;
--- a/hedgewars/HHHandlers.inc	Mon Oct 11 20:47:17 2010 +0200
+++ b/hedgewars/HHHandlers.inc	Mon Oct 11 14:55:13 2010 -0400
@@ -327,14 +327,14 @@
             end
         else
             begin
-            OnUsedAmmo(CurrentHedgehog^);
             if ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEndHint) = 0) and ((GameFlags and gfInfAttack) = 0) then
                 begin
                 TurnTimeLeft:= Ammoz[CurAmmoType].TimeAfterTurn;
                 State:= State or gstAttacked
                 end;
             if (Ammoz[CurAmmoType].Ammo.Propz and ammoprop_NoRoundEndHint) <> 0 then ApplyAmmoChanges(CurrentHedgehog^);
-            if (GameFlags and gfInfAttack) <> 0 then State:= State or gstAttacked
+            if (GameFlags and gfInfAttack) <> 0 then State:= State or gstAttacked;
+            OnUsedAmmo(CurrentHedgehog^)
             end;
         end
     else