diff -r 94f4d0a96143 -r 0a172cfe8840 hedgewars/uAIAmmoTests.pas --- a/hedgewars/uAIAmmoTests.pas Thu Sep 10 09:30:41 2020 +0200 +++ b/hedgewars/uAIAmmoTests.pas Wed Oct 07 23:06:34 2020 +0200 @@ -35,6 +35,7 @@ aiGravity: hwFloat; aiGravityf: real; aiLaserSighting: boolean; + aiHogsInTeam: LongInt; type TAttackParams = record Time, Bounce, AttacksNum: Longword; @@ -1337,6 +1338,10 @@ else exit(BadTurn); + // Don't sacrifice last hog + if aiHogsInTeam <= 1 then + exit(BadTurn); + valueResult:= 0; v:= 0; @@ -1972,6 +1977,10 @@ if (Level > 2) then exit(BadTurn); +// Don't sacrifice last hog +if aiHogsInTeam <= 1 then + exit(BadTurn); + ap.Angle:= 0; ap.AttackPutX:= Targ.Point.X; ap.AttackPutY:= Targ.Point.Y;