add missing nil check, increase despeckling of background too
authornemo
Sun, 26 Jun 2011 16:34:31 -0400
changeset 5322 1bcc12a30d5d
parent 5319 51d8e4747876
child 5325 261b79ba22b1
add missing nil check, increase despeckling of background too
hedgewars/HHHandlers.inc
hedgewars/uLandGraphics.pas
--- 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;
 
--- a/hedgewars/uLandGraphics.pas	Sun Jun 26 15:23:45 2011 -0400
+++ b/hedgewars/uLandGraphics.pas	Sun Jun 26 16:34:31 2011 -0400
@@ -746,7 +746,7 @@
             LandPixels[yy, xx]:= 0;
 
         Land[Y, X]:= 0;
-        if not pixelsweep then exit(true);
+        exit(true);
         end;
     end;
 Despeckle:= false