Adjust increment since there is no timer
authornemo
Thu, 18 Mar 2010 23:56:06 +0000
changeset 3022 94afd5fc5738
parent 3021 1d3302ac371f
child 3023 a5d0549aebee
Adjust increment since there is no timer
hedgewars/uAIAmmoTests.pas
--- a/hedgewars/uAIAmmoTests.pas	Thu Mar 18 23:25:32 2010 +0000
+++ b/hedgewars/uAIAmmoTests.pas	Thu Mar 18 23:56:06 2010 +0000
@@ -161,7 +161,6 @@
 end;
 
 function TestMolotov(Me: PGear; Targ: TPoint; Level: LongInt; var ap: TAttackParams): LongInt;
-const tDelta = 24;
 var Vx, Vy, r: hwFloat;
     Score, EX, EY, valueResult: LongInt;
     TestTime: Longword;
@@ -190,9 +189,9 @@
 TestTime:= 0;
 ap.ExplR:= 0;
 repeat
-  inc(TestTime, 1000);
-  Vx:= (int2hwFloat(Targ.X) - Me^.X) / int2hwFloat(TestTime + tDelta);
-  Vy:= cGravity * ((TestTime + tDelta) div 2) - (int2hwFloat(Targ.Y) - Me^.Y) / int2hwFloat(TestTime + tDelta);
+  inc(TestTime, 300);
+  Vx:= (int2hwFloat(Targ.X) - Me^.X) / int2hwFloat(TestTime);
+  Vy:= cGravity * (TestTime div 2) - (int2hwFloat(Targ.Y) - Me^.Y) / int2hwFloat(TestTime);
   r:= Distance(Vx, Vy);
   if not (r > _1) then
      begin
@@ -208,7 +207,7 @@
         valueResult:= Score
         end;
      end
-until (TestTime = 4000);
+until (TestTime > 4250);
 TestMolotov:= valueResult
 end;