hedgewars/uAIAmmoTests.pas
changeset 8862 85eb1f4b4a5f
parent 8824 fe9eacd390f2
child 8895 95177c18e38c
--- a/hedgewars/uAIAmmoTests.pas	Thu Apr 04 15:54:34 2013 -0400
+++ b/hedgewars/uAIAmmoTests.pas	Thu Apr 04 20:31:41 2013 -0400
@@ -249,6 +249,8 @@
                 end;
             EX:= trunc(x);
             EY:= trunc(y);
+            // Try to prevent AI from thinking firing into water will cause a drowning
+            if (EY < cWaterLine-5) and (Timer > 0) and (Abs(Targ.X - trunc(x)) + Abs(Targ.Y - trunc(y)) > 21) then exit(BadTurn);
             if Level = 1 then
                 value:= RateExplosion(Me, EX, EY, 101, afTrackFall or afErasesLand)
             else value:= RateExplosion(Me, EX, EY, 101);