Don't stick to enemies when there are more than 2 clans
authorunc0rr
Tue, 21 Jun 2011 16:42:04 +0400
changeset 5244 1b408b965c01
parent 5243 f2e31a7f953a
child 5247 bf6d4bc531d2
Don't stick to enemies when there are more than 2 clans
hedgewars/uAIMisc.pas
--- a/hedgewars/uAIMisc.pas	Tue Jun 14 16:50:41 2011 -0400
+++ b/hedgewars/uAIMisc.pas	Tue Jun 21 16:42:04 2011 +0400
@@ -134,7 +134,7 @@
 Gear:= GearsList;
 while Gear <> nil do
     begin
-	if (filter = []) or (Gear^.Kind in filter) then
+    if (filter = []) or (Gear^.Kind in filter) then
       case Gear^.Kind of
           gtCase: AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 33, 25);
           gtFlame: if (Gear^.State and gsttmpFlag) <> 0 then
@@ -152,7 +152,7 @@
                           AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 60, -25)
                       else
                           if isAfterAttack and (ThinkingHH^.Hedgehog <> Gear^.Hedgehog) then
-                              if (MyClan = Gear^.Hedgehog^.Team^.Clan) then
+                              if (ClansCount > 2) or (MyClan = Gear^.Hedgehog^.Team^.Clan) then
                                   AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 150, -3) // hedgehog-friend
                               else
                                   AddBonus(hwRound(Gear^.X), hwRound(Gear^.Y), 100, 3)