hedgewars/uAIMisc.pas
changeset 6768 a142cf8dbbd3
parent 6767 ccbf07b38a43
child 6769 44ad49a3a126
equal deleted inserted replaced
6767:ccbf07b38a43 6768:a142cf8dbbd3
   261     // ok. attempt approximate search for an unbroken trajectory into water.  if it continues far enough, assume out of map
   261     // ok. attempt approximate search for an unbroken trajectory into water.  if it continues far enough, assume out of map
   262     rCorner:= r * 0.75;
   262     rCorner:= r * 0.75;
   263     while true do
   263     while true do
   264         begin
   264         begin
   265         x:= x + dX;
   265         x:= x + dX;
   266         y:= y + dY + cGravityf;
   266         y:= y + dY;
       
   267         dY:= dY + cGravityf;
   267         skipLandCheck:= (r <> 0) and (abs(eX-x) + abs(eY-y) < r) and ((abs(eX-x) < rCorner) or (abs(eY-y) < rCorner));
   268         skipLandCheck:= (r <> 0) and (abs(eX-x) + abs(eY-y) < r) and ((abs(eX-x) < rCorner) or (abs(eY-y) < rCorner));
   268         if not skipLandCheck and TestCollWithLand(trunc(x), trunc(y), cHHRadius) then exit(false);
   269         if not skipLandCheck and TestCollWithLand(trunc(x), trunc(y), cHHRadius) then exit(false);
   269         if (y > cWaterLine) or (x > 4096) or (x < 0) then exit(true);
   270         if (y > cWaterLine) or (x > 4096) or (x < 0) then exit(true);
   270         end;
   271         end;
   271 end;
   272 end;