# HG changeset patch
# User nemo
# Date 1368234006 14400
# Node ID d360e97ce842551e1b1258bc25065b3390a52d4d
# Parent  7bcb77379a4b16146193df7f2b53061f34e497f0
I don't see how rating these against others is useful, given the limited radius, and the cluster bomb thing just seems counterproductive.  Anyway, this prevents AI from picking on barrels.

diff -r 7bcb77379a4b -r d360e97ce842 hedgewars/uAIAmmoTests.pas
--- a/hedgewars/uAIAmmoTests.pas	Fri May 10 12:00:51 2013 -0400
+++ b/hedgewars/uAIAmmoTests.pas	Fri May 10 21:00:06 2013 -0400
@@ -476,7 +476,7 @@
     else
         Score:= BadTurn;
 
-     if valueResult < Score then
+     if Score > 0 then
         begin
         ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random(Level * 2));
         ap.Power:= trunc(sqrt(r) * cMaxPower) + AIrndSign(random(Level) * 15);
@@ -683,7 +683,7 @@
     d: Longword;
     fallDmg, valueResult: LongInt;
 begin
-if Level > 4 then exit(BadTurn);
+if (Level > 4) or (Targ.Score < 0) or (Targ.Kind <> gtHedgehog) then exit(BadTurn);
 Level:= Level; // avoid compiler hint
 ap.ExplR:= 1;
 ap.Time:= 0;
@@ -726,7 +726,7 @@
     d: Longword;
     fallDmg: LongInt;
 begin
-if Level > 3 then exit(BadTurn);
+if (Level > 3) or (Targ.Score < 0) or (Targ.Kind <> gtHedgehog) then exit(BadTurn);
 Level:= Level; // avoid compiler hint
 ap.ExplR:= 0;
 ap.Time:= 0;