Fix AI sometimes using up all health in resurrector
authorWuzzy <Wuzzy2@mail.ru>
Wed, 08 Jul 2020 19:46:06 +0200
changeset 15707 26c6e5325075
parent 15706 f2930fe1b6d0
child 15708 88037382ae43
Fix AI sometimes using up all health in resurrector
hedgewars/uAI.pas
--- a/hedgewars/uAI.pas	Wed Jul 08 19:11:00 2020 +0200
+++ b/hedgewars/uAI.pas	Wed Jul 08 19:46:06 2020 +0200
@@ -265,8 +265,12 @@
                                 AddAction(BestActions, aia_attack, aim_release, ap.Power, 0, 0);
                                 end;
                             if (a = amResurrector) and (BotLevel < 4) then
+                                begin
                                 AddAction(BestActions, aia_Up, aim_release, ap.Power, 0, 0);
-                            AddAction(BestActions, aia_attack, aim_release, ap.Power, 0, 0);
+                                AddAction(BestActions, aia_attack, aim_release, 0, 0, 0);
+                                end
+                            else
+                                AddAction(BestActions, aia_attack, aim_release, ap.Power, 0, 0);
 
                             // Just for fun: 0.01% chance for kamikaze with "wishes" ;-)
                             if (a = amKamikaze) and (random(10000) = 0) then