Skip to content

fix AI ships getting permanently stuck after losing or refusing a target - #7736

Open
Goober5000 wants to merge 1 commit into
scp-fs2open:masterfrom
Goober5000:fix/actively_pursues
Open

fix AI ships getting permanently stuck after losing or refusing a target#7736
Goober5000 wants to merge 1 commit into
scp-fs2open:masterfrom
Goober5000:fix/actively_pursues

Conversation

@Goober5000

@Goober5000 Goober5000 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Generalize the unreleased "$fix target updating with strafe:" ai_profiles flag into "$fix ai target recovery:", which now also covers two more ways a ship holding a standing chase order could park in AIM_NONE forever:

  • a ship already in AIM_NONE with a standing chase order (attack-any etc.) now clears its active goal so the order is re-processed, closing the window where retargeting finds a new enemy before the strafe clause can fire
  • target selection (find_enemy/get_nearest_objnum) now skips ships outside the attacker's actively-pursues list, and ai_chase() drops self-chosen targets it refuses, instead of holding a target it will never attack

Retail behavior is unchanged when the flag is disabled; explicit orders on non-pursued targets are still declined as before.

Follow-up to, and supersedes, #7619.

@Goober5000
Goober5000 requested a review from wookieejedi August 24, 2026 02:17
@Goober5000 Goober5000 added fix A fix for bugs, not-a-bugs, and/or regressions. Point Release Candidate An already merged bugfix that may be merged into a previous stable version labels Aug 24, 2026
@Goober5000 Goober5000 added this to the Release 26.0.1 milestone Aug 24, 2026
@Goober5000 Goober5000 added the ai A feature or issue related to the AI algorithms label Aug 24, 2026
@Goober5000
Goober5000 force-pushed the fix/actively_pursues branch 3 times, most recently from db1aeb1 to 0681467 Compare August 24, 2026 05:55
Generalize the unreleased "$fix target updating with strafe:" ai_profiles flag
into "$fix ai target recovery:", which now also covers two more ways a ship
holding a standing chase order could park in AIM_NONE forever:

* a ship already in AIM_NONE with a standing chase order (attack-any etc.) now
  clears its active goal so the order is re-processed, closing the window where
  retargeting finds a new enemy before the strafe clause can fire
* target selection (find_enemy/get_nearest_objnum) now skips ships outside the
  attacker's actively-pursues list, and ai_chase() drops self-chosen targets it
  refuses, instead of holding a target it will never attack

Retail behavior is unchanged when the flag is disabled; explicit orders on
non-pursued targets are still declined as before.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Goober5000
Goober5000 force-pushed the fix/actively_pursues branch from 0681467 to bbd860c Compare August 24, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai A feature or issue related to the AI algorithms fix A fix for bugs, not-a-bugs, and/or regressions. Point Release Candidate An already merged bugfix that may be merged into a previous stable version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants