fix dual fire handling for banks that cannot use it#7635
Draft
Goober5000 wants to merge 1 commit into
Draft
Conversation
The Secondary_dual_fire flag is per-ship, but not every secondary bank can dual fire. Previously the HUD drew the dual fire link icon even when the armed bank had only one firepoint, and firing such a bank cleared the flag entirely, silently discarding the player's dual fire preference for the other banks. Extend the ignored-rather-than-cleared approach already established for no-doublefire weapons to the single-firepoint case: - add ship_secondary_bank_can_dual_fire() as the single source of truth for bank validity, No_doublefire, ai_profiles restrictions, and firepoint count - ship_fire_secondary() now fires single and leaves the flag alone when the bank cannot dual fire, instead of removing the flag - the weapons gauges and the hardpoints gauge consult the helper, so the link icon and second-firepoint highlight are no longer drawn for incapable banks - the dual fire toggle on a single-firepoint bank now explains why it cannot dual fire and leaves the preference untouched - restoring the saved dual fire preference no longer depends on bank 0's firepoint count, since incapable banks now simply ignore the flag - weapon_create()'s substitution pattern logic also consults the helper so the pattern index no longer advances as if a pair were fired Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Secondary_dual_fire flag is per-ship, but not every secondary bank can dual fire. Previously the HUD drew the dual fire link icon even when the armed bank had only one firepoint, and firing such a bank cleared the flag entirely, silently discarding the player's dual fire preference for the other banks.
Extend the ignored-rather-than-cleared approach already established for no-doublefire weapons to the single-firepoint case: