hedgewars/uAIAmmoTests.pas
changeset 5164 a2a67433633d
parent 5151 cbadb9fa52fc
child 5642 0ce9e01bae56
--- a/hedgewars/uAIAmmoTests.pas	Tue Apr 19 14:20:52 2011 +0400
+++ b/hedgewars/uAIAmmoTests.pas	Tue Apr 19 14:39:55 2011 +0400
@@ -467,9 +467,9 @@
             dY:= dY + cGravity;
             EX:= hwRound(x);
             EY:= hwRound(y);
-        until TestCollExcludingMe(Me, EX, EY, 5) or (EY > 1000);
+        until TestCollExcludingMe(Me, EX, EY, 5) or (EY > cWaterLine);
 
-        if (EY < 1000) and not dY.isNegative then
+        if (EY < cWaterLine) and not dY.isNegative then
             begin
             value:= RateExplosion(Me, EX, EY, 91);
             if (value = 0) then
@@ -622,7 +622,7 @@
 x:= Me^.X;
 y:= Me^.Y;
 if (Targ.X) - hwRound(x) >= 0 then ap.Angle:=   cMaxAngle div 4
-                                  else ap.Angle:= - cMaxAngle div 4;
+                              else ap.Angle:= - cMaxAngle div 4;
 valueResult:= RateShove(Me, hwRound(x) + 10 * hwSign(int2hwFloat(Targ.X) - x), hwRound(y), 15, 30);
 if valueResult <= 0 then valueResult:= BadTurn else inc(valueResult);
 TestBaseballBat:= valueResult;
@@ -706,7 +706,7 @@
           // 58 (instead of 60) for better prediction (hh moves after explosion of one of the rockets)
           end
        end;
-until fexit or (Y > _1024);
+until fexit or (Y.Round > cWaterLine);
 
 for i:= 0 to 5 do inc(valueResult, dmg[i]);
 t:= valueResult;