Skip to content

give the "Set as Player Ship" button exclusive semantics in both editors#7605

Merged
JohnAFernandez merged 1 commit into
scp-fs2open:masterfrom
Goober5000:fix/set_player_ship
Jul 15, 2026
Merged

give the "Set as Player Ship" button exclusive semantics in both editors#7605
JohnAFernandez merged 1 commit into
scp-fs2open:masterfrom
Goober5000:fix/set_player_ship

Conversation

@Goober5000

Copy link
Copy Markdown
Contributor

In single-player missions, the "Set as Player Ship" button is supposed to make the selected ship the one and only player start. FRED did this correctly, but qtFRED routed the button through the same setPlayer() toggle used by the multiplayer "Player Ship" checkbox, which only promoted the selected ship and never demoted the previous player start. Since the checkbox is disabled in single player, there was no way to demote the old start, so single-player missions could accumulate multiple player starts.

Consolidate the exclusive logic into a shared helper, set_single_player_start() in missioneditor/common.cpp, and call it from both FRED's OnSetAsPlayerShip() and a new qtFRED model method, makeSolePlayerStart(), which the button now uses. This also avoids setPlayer()'s early return on stale dialog state, which could cause the button to silently do nothing.

Follow-up to #7600.

In single-player missions, the "Set as Player Ship" button is supposed to make
the selected ship the one and only player start.  FRED did this correctly, but
qtFRED routed the button through the same setPlayer() toggle used by the
multiplayer "Player Ship" checkbox, which only promoted the selected ship and
never demoted the previous player start.  Since the checkbox is disabled in
single player, there was no way to demote the old start, so single-player
missions could accumulate multiple player starts.

Consolidate the exclusive logic into a shared helper,
set_single_player_start() in missioneditor/common.cpp, and call it from both
FRED's OnSetAsPlayerShip() and a new qtFRED model method,
makeSolePlayerStart(), which the button now uses.  This also avoids
setPlayer()'s early return on stale dialog state, which could cause the button
to silently do nothing.

Follow-up to scp-fs2open#7600.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Goober5000 Goober5000 added cleanup A modification or rewrite of code to make it more understandable or easier to maintain. fix A fix for bugs, not-a-bugs, and/or regressions. qtfred A feature or issue related to qtFred. fred A feature or issue related to the FReespace EDitor (FRED) labels Jul 14, 2026
@github-project-automation github-project-automation Bot moved this to Work In Progress (PRs) in qtFRED2 Jul 14, 2026
@github-project-automation github-project-automation Bot moved this from Work In Progress (PRs) to In Review (PRs) in qtFRED2 Jul 14, 2026
@JohnAFernandez JohnAFernandez merged commit 9bebf25 into scp-fs2open:master Jul 15, 2026
18 checks passed
@github-project-automation github-project-automation Bot moved this from In Review (PRs) to Done in qtFRED2 Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup A modification or rewrite of code to make it more understandable or easier to maintain. fix A fix for bugs, not-a-bugs, and/or regressions. fred A feature or issue related to the FReespace EDitor (FRED) qtfred A feature or issue related to qtFred.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants