# HG changeset patch # User nemo # Date 1418052620 18000 # Node ID 13a5dd92ebf9d4094bb06389f5d34736d2f39266 # Parent aba9ae27ead018e18316d6e896a4f4647830010e init timer to 0 diff -r aba9ae27ead0 -r 13a5dd92ebf9 hedgewars/uAIAmmoTests.pas --- a/hedgewars/uAIAmmoTests.pas Mon Dec 08 10:24:06 2014 -0500 +++ b/hedgewars/uAIAmmoTests.pas Mon Dec 08 10:30:20 2014 -0500 @@ -211,6 +211,7 @@ rTime:= 350; ap.ExplR:= 0; valueResult:= BadTurn; + timer:= 0; repeat rTime:= rTime + 300 + Level * 50 + random(300); Vx:= - windSpeed * rTime * 0.5 + (Targ.Point.X + AIrndSign(2) - mX) / rTime; @@ -253,7 +254,7 @@ 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.Point.X - trunc(x)) + Abs(Targ.Point.Y - trunc(y)) > 21) then exit(BadTurn); + if (EY < cWaterLine-5) and (timer > 0) and (Abs(Targ.Point.X - trunc(x)) + Abs(Targ.Point.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);