Prefer to bat enemy away dealing the same amount of damage
authorunc0rr
Tue, 24 Jul 2012 16:12:41 +0400
changeset 7424 fe0f07667f24
parent 7421 76772043ba7f
child 7427 48f9d53c844a
Prefer to bat enemy away dealing the same amount of damage
hedgewars/uAIAmmoTests.pas
--- a/hedgewars/uAIAmmoTests.pas	Tue Jul 24 16:10:09 2012 +0400
+++ b/hedgewars/uAIAmmoTests.pas	Tue Jul 24 16:12:41 2012 +0400
@@ -709,10 +709,10 @@
     x:= hwRound(Me^.X);
     y:= hwRound(Me^.Y);
 
-    a:= 0;
+    a:= cMaxAngle div 2;
     valueResult:= 0;
 
-    while a <= cMaxAngle div 2 do
+    while a >= 0 do
         begin
         dx:= sin(a / cMaxAngle * pi) * 0.5;
         dy:= cos(a / cMaxAngle * pi) * 0.5;
@@ -736,7 +736,7 @@
                 valueResult:= v1
                 end;
 
-        a:= a + 15 + random(cMaxAngle div 16)
+        a:= a - 15 - random(cMaxAngle div 16)
         end;
    
     if valueResult <= 0 then