diff --git a/RP_L4/RPL4CONSOLE.cpp b/RP_L4/RPL4CONSOLE.cpp index 8b8309b..85ecdbb 100644 --- a/RP_L4/RPL4CONSOLE.cpp +++ b/RP_L4/RPL4CONSOLE.cpp @@ -704,6 +704,32 @@ namespace switch (gPhase) { case PhaseWaiting: + // + // A mission can die before it ever runs - Alt+Q during the + // commit hold, or while loading. The console only learned a + // mission was over from PhaseRunning, so an abort during prep + // left it in PhaseWaiting forever, MissionCompleted() answered + // False, and WinMain's single-binary loop fell out to the + // DESKTOP instead of returning to the setup screen. The commit + // hold makes the prep window somewhere players actually stand, + // so the hole finally had traffic. A prep death counts as a + // completed mission now: back to the menu, lobby intact. + // + if (state == Application::EndingMission || + state == Application::StoppingMission || + state == Application::AbortingMission) + { + DEBUG_STREAM << "LocalConsole: mission ended during prep - " + << "back to the menu\n" << std::flush; + InterlockedExchange(&gMissionRunning, 0); + gPhase = PhaseStopped; + DestroyStatusBoard(); + if (gNetworkRace) + { + DisconnectRemotes(); + } + break; + } if (gNetworkRace) { MarshalRemotes();