Use cWaterLine instead of LAND_HEIGHT, fix mortar handler aswell
authorunc0rr
Tue, 19 Apr 2011 14:39:55 +0400
changeset 5164 a2a67433633d
parent 5163 1620a02d5282
child 5165 91fb710a6668
Use cWaterLine instead of LAND_HEIGHT, fix mortar handler aswell
hedgewars/uAIAmmoTests.pas
--- 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;