--- a/hedgewars/uAI.pas Wed May 15 10:05:13 2024 +0200
+++ b/hedgewars/uAI.pas Thu May 16 14:11:16 2024 +0200
@@ -228,12 +228,14 @@
if dAngle > 0 then
begin
AddAction(BestActions, aia_Up, aim_push, 300 + random(250), 0, 0);
- AddAction(BestActions, aia_Up, aim_release, dAngle, 0, 0)
+ AddAction(BestActions, aia_waitAngle, ap.Angle, 1, 0, 0);
+ AddAction(BestActions, aia_Up, aim_release, 1, 0, 0)
end
else if dAngle < 0 then
begin
AddAction(BestActions, aia_Down, aim_push, 300 + random(250), 0, 0);
- AddAction(BestActions, aia_Down, aim_release, -dAngle, 0, 0)
+ AddAction(BestActions, aia_waitAngle, ap.Angle, 1, 0, 0);
+ AddAction(BestActions, aia_Down, aim_release, 1, 0, 0)
end
end;
--- a/hedgewars/uAIAmmoTests.pas Wed May 15 10:05:13 2024 +0200
+++ b/hedgewars/uAIAmmoTests.pas Thu May 16 14:11:16 2024 +0200
@@ -2478,7 +2478,7 @@
Vy:= (Targ.Point.Y - y) * 1 / 1024;
ap.Angle:= DxDy2AttackAnglef(Vx, -Vy);
// Minigun angle is limited
-if (ap.Angle < Ammoz[amMinigun].minAngle) or (ap.Angle > Ammoz[amMinigun].maxAngle) then
+if (abs(ap.Angle) < Ammoz[amMinigun].minAngle) or (abs(ap.Angle) > Ammoz[amMinigun].maxAngle) then
exit(BadTurn);
// Apply inaccuracy