fix incorrect mask set in r7b4643ff60ea - this causes ghost hog collisions and odd hog jumps on overlap with active hog
authornemo
Wed, 09 Jan 2019 16:27:57 -0500
changeset 14531 e0af4ce7d8bc
parent 14530 ec0afe1c6024
child 14532 e1ae6d8e84b0
fix incorrect mask set in r7b4643ff60ea - this causes ghost hog collisions and odd hog jumps on overlap with active hog
hedgewars/uCollisions.pas
--- a/hedgewars/uCollisions.pas	Wed Jan 09 19:39:48 2019 +0100
+++ b/hedgewars/uCollisions.pas	Wed Jan 09 16:27:57 2019 -0500
@@ -501,7 +501,7 @@
             begin
             if Land[y, x] and Gear^.CollisionMask <> 0 then
                 begin
-                if ((Land[y, x] and Gear^.CollisionMask) and lfNotObjMask) <> 0 then
+                if ((Land[y, x] and Gear^.CollisionMask) and lfLandMask) <> 0 then
                     exit(Land[y, x] and Gear^.CollisionMask)
                 else
                     pixel:= Land[y, x] and Gear^.CollisionMask;
@@ -567,7 +567,7 @@
     if (x and LAND_WIDTH_MASK) = 0 then
         if Land[y, x] > 0 then
             begin
-            if ((Land[y, x] and Gear^.CollisionMask) and lfNotObjMask) <> 0 then
+            if ((Land[y, x] and Gear^.CollisionMask) and lfLandMask) <> 0 then
                 exit(Land[y, x] and Gear^.CollisionMask)
             else // if Land[y, x] <> 0 then
                 pixel:= Land[y, x] and Gear^.CollisionMask;
@@ -642,7 +642,7 @@
     i:= y + Gear^.Radius * 2 - 2;
     repeat
         if (y and LAND_HEIGHT_MASK) = 0 then
-            if ((Land[y, x] and Gear^.CollisionMask) and lfNotObjMask) <> 0 then
+            if ((Land[y, x] and Gear^.CollisionMask) and lfLandMask) <> 0 then
                 exit(Land[y, x] and Gear^.CollisionMask);
     inc(y)
     until (y > i);
@@ -665,7 +665,7 @@
     i:= x + Gear^.Radius * 2 - 2;
     repeat
         if (x and LAND_WIDTH_MASK) = 0 then
-            if ((Land[y, x] and Gear^.CollisionMask) and lfNotObjMask) <> 0 then
+            if ((Land[y, x] and Gear^.CollisionMask) and lfLandMask) <> 0 then
                 exit(Land[y, x] and Gear^.CollisionMask);
     inc(x)
     until (x > i);
@@ -981,7 +981,7 @@
     i:= x + Gear^.Radius * 2 - 2;
     repeat
     if (x and LAND_WIDTH_MASK) = 0 then
-        if (Land[y, x] and lfNotObjMask) <> 0 then
+        if (Land[y, x] and lfLandMask) <> 0 then
             if (not isColl) or (abs(x-gx) < abs(collX-gx)) then
                 begin
                 isColl:= true;