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 4 times, most recently from 0681467 to bbd860c Compare August 24, 2026 06:12
@Goober5000
Goober5000 marked this pull request as draft August 25, 2026 03:51
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 bbd860c to b25f448 Compare August 26, 2026 01:08
@Goober5000
Goober5000 marked this pull request as ready for review August 26, 2026 01:08

@wookieejedi wookieejedi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New updates look good too

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