hedgewars/uCollisions.pas
branchios-revival
changeset 11160 f1f044e88039
parent 11077 1fb80cd8ba7b
child 11532 bf86c6cb9341
--- a/hedgewars/uCollisions.pas	Fri Sep 11 21:41:35 2015 +0200
+++ b/hedgewars/uCollisions.pas	Sat Sep 12 04:02:27 2015 +0200
@@ -1,6 +1,6 @@
 (*
  * Hedgewars, a free turn based strategy game
- * Copyright (c) 2004-2014 Andrey Korotaev <unC0Rr@gmail.com>
+ * Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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;