Call OnUsedAmmo *after* doing the normal CurAmmoType stuff so CurAmmoType actually points to the right bloody weapon
--- 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