Skip to content

Commit 29fe214

Browse files
committed
end the campaign properly when a mission is skipped
The "skip training" button and the "exit loop" button should both check whether the campaign is actually over before attempting to load the next mission. The fix is simple - just use the same logic as in `mission_campaign_skip_to_next`. Fixes #4412.
1 parent e27bf0c commit 29fe214

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

code/mission/missioncampaign.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1822,7 +1822,12 @@ void mission_campaign_exit_loop()
18221822

18231823
// set things up for next mission
18241824
mission_campaign_next_mission();
1825-
gameseq_post_event(GS_EVENT_START_GAME);
1825+
1826+
if ( Campaign.next_mission == -1 || (The_mission.flags[Mission::Mission_Flags::End_to_mainhall]) ) {
1827+
gameseq_post_event( GS_EVENT_MAIN_MENU );
1828+
} else {
1829+
gameseq_post_event( GS_EVENT_START_GAME );
1830+
}
18261831
}
18271832

18281833

code/missionui/missionbrief.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ void brief_skip_training_pressed()
351351
mission_campaign_eval_next_mission();
352352
mission_campaign_mission_over();
353353

354-
if ( The_mission.flags[Mission::Mission_Flags::End_to_mainhall] ) {
354+
if ( Campaign.next_mission == -1 || (The_mission.flags[Mission::Mission_Flags::End_to_mainhall]) ) {
355355
gameseq_post_event( GS_EVENT_MAIN_MENU );
356356
} else {
357357
gameseq_post_event( GS_EVENT_START_GAME );

0 commit comments

Comments
 (0)