hedgewars/HHHandlers.inc
changeset 5322 1bcc12a30d5d
parent 5319 51d8e4747876
child 5343 ff7ecf483759
--- a/hedgewars/HHHandlers.inc	Sun Jun 26 15:23:45 2011 -0400
+++ b/hedgewars/HHHandlers.inc	Sun Jun 26 16:34:31 2011 -0400
@@ -173,6 +173,7 @@
     altUse: boolean;
     elastic: hwFloat;
 begin
+newGear:= nil;
 bShowFinger:= false;
 CurWeapon:= GetAmmoEntry(Gear^.Hedgehog^);
 with Gear^,
@@ -376,7 +377,7 @@
         // Clear FollowGear if using on a rope/parachute/saucer etc so focus stays with the hog's movement
         if altUse then FollowGear:= nil;
 
-        if ((Ammoz[newGear^.AmmoType].Ammo.Propz and ammoprop_SetBounce) <> 0) and (newGear <> nil) then
+        if (newGear <> nil) and ((Ammoz[newGear^.AmmoType].Ammo.Propz and ammoprop_SetBounce) <> 0) then
             begin
             elastic:=  int2hwfloat(CurWeapon^.Bounciness) / _1000;