Fix TestCollExcludingMe function. Now it doesn't skip test if there are more then one hog at checking pixel
authorUrbertar
Thu, 28 Mar 2013 18:34:53 +0200
changeset 8810 b885b995aa95
parent 8808 636cd1b8361d
child 8812 fdac638c6f9a
Fix TestCollExcludingMe function. Now it doesn't skip test if there are more then one hog at checking pixel
hedgewars/uAIMisc.pas
--- a/hedgewars/uAIMisc.pas	Thu Mar 28 18:34:30 2013 +0200
+++ b/hedgewars/uAIMisc.pas	Thu Mar 28 18:34:53 2013 +0200
@@ -266,7 +266,7 @@
         MeX:= hwRound(Me^.X);
         MeY:= hwRound(Me^.Y);
         // We are still inside the hog. Skip radius test
-        if ((((x-MeX)*(x-MeX)) + ((y-MeY)*(y-MeY))) < 256) and (Land[y, x] <= lfAllObjMask) then
+        if ((((x-MeX)*(x-MeX)) + ((y-MeY)*(y-MeY))) < 256) and (Land[y, x] <= lfAllObjMask) and ((Land[y, x] and lfObjMask) < 2) then
             exit(false);
     end;
     TestCollExcludingMe:= TestColl(x, y, r)