trying to unbreak what I broke
authornemo
Thu, 06 May 2010 03:12:42 +0000
changeset 3431 e36dffdf7b82
parent 3430 21c08c95a672
child 3432 83cef0f08a86
trying to unbreak what I broke
hedgewars/GSHandlers.inc
hedgewars/HHHandlers.inc
--- a/hedgewars/GSHandlers.inc	Thu May 06 02:00:39 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Thu May 06 03:12:42 2010 +0000
@@ -1937,9 +1937,6 @@
 else begin
     PlaySound(sndPlaced);
     DeleteGear(Gear);
-    //Using these two instead means girder stays active without needing to reselect it
-    //OnUsedAmmo(PHedgehog(HHGear^.Hedgehog)^);
-    //ApplyAmmoChanges(PHedgehog(HHGear^.Hedgehog)^)
     AfterAttack;
     end;
 
--- a/hedgewars/HHHandlers.inc	Thu May 06 02:00:39 2010 +0000
+++ b/hedgewars/HHHandlers.inc	Thu May 06 03:12:42 2010 +0000
@@ -277,14 +277,17 @@
             end
         else
             begin
-            OnUsedAmmo(CurrentHedgehog^);
             if ((Ammo^[CurSlot, CurAmmo].Propz) and ammoprop_NoRoundEndHint) = 0 then
                 begin
+                OnUsedAmmo(CurrentHedgehog^);
                 TurnTimeLeft:= Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType].TimeAfterTurn;
                 State:= State or gstAttacked
                 end
             else
-                ApplyAmmoChanges(CurrentHedgehog^);
+                begin
+                OnUsedAmmo(CurrentHedgehog^);
+                ApplyAmmoChanges(CurrentHedgehog^)
+                end
             end;
         end
     else