AI: Don't use airstrikes if negative gravity
authorWuzzy <Wuzzy2@mail.ru>
Wed, 08 Jul 2020 18:19:14 +0200
changeset 15702 0436ea41ece5
parent 15701 f8688e1bcc13
child 15703 8111e2505a48
AI: Don't use airstrikes if negative gravity
hedgewars/uAIAmmoTests.pas
--- a/hedgewars/uAIAmmoTests.pas	Wed Jul 08 18:17:49 2020 +0200
+++ b/hedgewars/uAIAmmoTests.pas	Wed Jul 08 18:19:14 2020 +0200
@@ -1432,7 +1432,7 @@
 Flags:= Flags; // avoid compiler hint
 ap.ExplR:= 0;
 ap.Time:= 0;
-if (Level > 3) or (aiGravityf = 0) then
+if (Level > 3) or (aiGravityf <= 0) then
     exit(BadTurn);
 
 ap.Angle:= 0;
@@ -1562,7 +1562,7 @@
 begin
 Flags:= Flags; // avoid compiler hint
 ap.ExplR:= 0;
-if (Level > 3) or (aiGravityf = 0) then
+if (Level > 3) or (aiGravityf <= 0) then
     exit(BadTurn);
 
 ap.Angle:= 0;
@@ -1723,7 +1723,7 @@
 // so they are unsupported.
 // TODO: Implement mine strike for other values of MineTime
 // TODO: Teach AI to avoid hitting their own with mines
-if (Level > 3) or (aiGravityf = 0) or (cMinesTime <> 0) then
+if (Level > 3) or (aiGravityf <= 0) or (cMinesTime <> 0) then
     exit(BadTurn);
 
 ap.Angle:= 0;