Skip to content

Fix 'ignore if dead' flag#7509

Merged
wookieejedi merged 2 commits into
scp-fs2open:masterfrom
wookieejedi:fix-ignoredead-flag
Jun 9, 2026
Merged

Fix 'ignore if dead' flag#7509
wookieejedi merged 2 commits into
scp-fs2open:masterfrom
wookieejedi:fix-ignoredead-flag

Conversation

@wookieejedi

@wookieejedi wookieejedi commented Jun 8, 2026

Copy link
Copy Markdown
Member

Fixes #7508.

The subsystem flag "ignore if dead" that many mods use is supposed to "prevent homing weapons from attempting to hit the now destroyed submodel and instead tells them to home on the main hull of the target."

Though, in actuality, the code makes the weapon dumb fire instead of home. This bug means if you destroy a subsystem with this flag, then lock onto it with an aspect weapon and fire the weapon, the weapon will just dumb fire.

With wp->homing_subsys cleared as this PR does, the homing code at weapons.cpp:5730 falls into its else branch and picks an attack point on the ship body (ai_big_pick_attack_point / hobjp->pos) — which is what the flag promises. Javelins, which can only home on engines, will still just drop lock if there's none though (edited for correction, previously stated javelins would acquire a new engine).

This fix is tested and now the flag works as expected.

Fixes scp-fs2open#7508.

The subsystem flag "ignore if dead" that many mods use is supposed to "prevent homing weapons from attempting to hit the now destroyed submodel and instead tells them to home on the main hull of the target."

Though, in actuality, the code makes the weapon dumb fire instead of home. This bug means if you destroy a subsystem with this flag, then lock onto it with an aspect weapon and fire the weapon, the weapon will just dumb fire.

With `wp->homing_subsys` cleared as this PR does, the homing code at `weapons.cpp`:5730 falls into its else branch and picks an attack point on the ship body (`ai_big_pick_attack_point / hobjp->pos`) — which is what the flag promises. Javelins, which can only home on engines, will still correctly try to re-acquire another engine in the block just below and drop lock if there's none.

This fix is tested and now the flag works as expected.
@wookieejedi wookieejedi added this to the Release 26.0 milestone Jun 8, 2026
@wookieejedi wookieejedi added the fix A fix for bugs, not-a-bugs, and/or regressions. label Jun 8, 2026

@Goober5000 Goober5000 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like Javelins will not try to reacquire lock here.

Also, this flag will need to be added to the wiki.

@wookieejedi

Copy link
Copy Markdown
Member Author

Updated to account for javelins, thanks!

@wookieejedi wookieejedi requested a review from Goober5000 June 8, 2026 12:24
@wookieejedi wookieejedi merged commit 0076cdb into scp-fs2open:master Jun 9, 2026
20 checks passed
@wookieejedi wookieejedi deleted the fix-ignoredead-flag branch June 9, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A fix for bugs, not-a-bugs, and/or regressions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Subsystem flag "ignore if dead" inadvertently disable aspect lock

2 participants