drill test tweak based on watching AI play
authornemo
Thu, 04 Apr 2013 20:31:41 -0400
changeset 8862 85eb1f4b4a5f
parent 8858 b216fe93bab1
child 8865 dd4035ee0f12
drill test tweak based on watching AI play
hedgewars/uAIAmmoTests.pas
--- 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);