hedgewars/uAIMisc.pas
branchphysfslayer
changeset 7928 88fde28bbda6
parent 7850 fcbb024090a4
child 7996 66e8ac9c2274
--- a/hedgewars/uAIMisc.pas	Sun Oct 21 01:28:33 2012 +0400
+++ b/hedgewars/uAIMisc.pas	Sat Nov 03 00:34:35 2012 +0400
@@ -110,7 +110,9 @@
             begin
             for i:= 0 to cMaxHHIndex do
                 if (Hedgehogs[i].Gear <> nil)
-                and (Hedgehogs[i].Gear <> ThinkingHH) then
+                and (Hedgehogs[i].Gear <> ThinkingHH) 
+                and (Hedgehogs[i].Gear^.Health > Hedgehogs[i].Gear^.Damage) 
+                    then
                     begin
                     with Targets.ar[Targets.Count], Hedgehogs[i] do
                         begin
@@ -119,11 +121,11 @@
                         Point.Y:= hwRound(Gear^.Y);
                         if Clan <> CurrentTeam^.Clan then
                             begin
-                            Score:=  Gear^.Health;
+                            Score:= Gear^.Health - Gear^.Damage;
                             inc(e)
                             end else
                             begin
-                            Score:= -Gear^.Health;
+                            Score:= Gear^.Damage - Gear^.Health;
                             inc(f)
                             end
                         end;
@@ -770,7 +772,6 @@
 
 procedure freeModule;
 begin
-
 end;
 
 end.