hedgewars/uAIMisc.pas
changeset 8744 6c87486fd89b
parent 8013 5cbf6e4361f4
child 8751 4609823efc94
--- a/hedgewars/uAIMisc.pas	Sun Mar 17 10:25:19 2013 -0400
+++ b/hedgewars/uAIMisc.pas	Sun Mar 17 14:09:54 2013 -0400
@@ -296,19 +296,19 @@
 function TestColl(x, y, r: LongInt): boolean; inline;
 var b: boolean;
 begin
-    b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x-r] and $FF7F <> 0);
+    b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x-r] and lfCurrentMask <> 0);
     if b then
         exit(true);
     
-    b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x-r] and $FF7F <> 0);
+    b:= (((x-r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x-r] and lfCurrentMask <> 0);
     if b then
         exit(true);
     
-    b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x+r] and $FF7F <> 0);
+    b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y-r) and LAND_HEIGHT_MASK) = 0) and (Land[y-r, x+r] and lfCurrentMask <> 0);
     if b then
         exit(true);
     
-    b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x+r] and $FF7F <> 0);
+    b:= (((x+r) and LAND_WIDTH_MASK) = 0) and (((y+r) and LAND_HEIGHT_MASK) = 0) and (Land[y+r, x+r] and lfCurrentMask <> 0);
     if b then
         exit(true);
     
@@ -712,7 +712,7 @@
 var pX, pY, tY: LongInt;
 begin
 HHGo:= false;
-Gear^.CollisionMask:= $FF7F;
+Gear^.CollisionMask:= lfCurrentMask;
 AltGear^:= Gear^;
 
 GoInfo.Ticks:= 0;