hedgewars/uCollisions.pas
changeset 11077 1fb80cd8ba7b
parent 11046 47a8c19ecb60
child 11532 bf86c6cb9341
--- a/hedgewars/uCollisions.pas	Fri Sep 04 08:14:12 2015 -0400
+++ b/hedgewars/uCollisions.pas	Thu Sep 10 04:59:02 2015 +0200
@@ -211,10 +211,15 @@
     i:= y + Gear^.Radius * 2 - 2;
     repeat
         if (y and LAND_HEIGHT_MASK) = 0 then
-            if Land[y, x] and Gear^.CollisionMask > 255 then
-                exit(Land[y, x] and Gear^.CollisionMask)
-            else if Land[y, x] and Gear^.CollisionMask <> 0 then
-                pixel:= Land[y, x] and Gear^.CollisionMask;
+            begin
+            if Land[y, x] and Gear^.CollisionMask <> 0 then
+                begin
+                if Land[y, x] and Gear^.CollisionMask > 255 then
+                    exit(Land[y, x] and Gear^.CollisionMask)
+                else
+                    pixel:= Land[y, x] and Gear^.CollisionMask;
+                end;
+            end;
     inc(y)
     until (y > i);
     end;
@@ -274,10 +279,12 @@
     repeat
     if (x and LAND_WIDTH_MASK) = 0 then
         if Land[y, x] > 0 then
+            begin
             if Land[y, x] and Gear^.CollisionMask > 255 then
                 exit(Land[y, x] and Gear^.CollisionMask)
-            else if Land[y, x] <> 0 then
+            else // if Land[y, x] <> 0 then
                 pixel:= Land[y, x] and Gear^.CollisionMask;
+            end;
     inc(x)
     until (x > i);
     end;