hedgewars/uAIAmmoTests.pas
changeset 42 72ffe21f027c
parent 39 b78e7185ed13
child 48 0f396d0c429d
--- a/hedgewars/uAIAmmoTests.pas	Mon Jan 09 20:29:14 2006 +0000
+++ b/hedgewars/uAIAmmoTests.pas	Mon Jan 09 20:33:12 2006 +0000
@@ -181,6 +181,11 @@
 function TestShotgun(Me, Targ: TPoint; Flags: Longword; out Time: Longword; out Angle, Power: integer): boolean;
 var Vx, Vy, x, y: real;
 begin
+if abs(Me.X - Targ.X) + abs(Me.Y - Targ.Y) < 80 then
+   begin
+   Result:= false;
+   exit
+   end;
 Time:= 0;
 Power:= 1;
 Vx:= (Targ.X - Me.X)/1024;
@@ -206,6 +211,11 @@
 var Vx, Vy, x, y: real;
     d: Longword;
 begin
+if abs(Me.X - Targ.X) + abs(Me.Y - Targ.Y) < 80 then
+   begin
+   Result:= false;
+   exit
+   end;
 Time:= 0;
 Power:= 1;
 Vx:= (Targ.X - Me.X)/1024;