From 7b5929399581a12a0c9ab96e67bf08fe5d416f44 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 23 Apr 2022 18:52:50 +0200 Subject: [PATCH] - properly deal with 'gototitle'. --- src/g_level.cpp | 11 +++++++++-- src/intermission/intermission.cpp | 16 +++++++++++----- wadsrc/static/mapinfo/common.txt | 3 --- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index 456778158a..94b507e7a7 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -942,6 +942,13 @@ DIntermissionController* FLevelLocals::CreateIntermission() void RunIntermission(DIntermissionController* intermissionScreen, DObject* statusScreen, std::function completionf) { + D_StartTitle(); + + if (!intermissionScreen && !statusScreen) + { + completionf(false); + return; + } runner = CreateRunner(false); GC::WriteBarrier(runner); completion = std::move(completionf); @@ -1010,9 +1017,9 @@ void G_DoCompleted (void) bool endgame = intermissionScreen && intermissionScreen->mEndGame; intermissionScreen = primaryLevel->CreateIntermission(); RunIntermission(intermissionScreen, statusScreen, [=](bool) - { + { if (!endgame) primaryLevel->WorldDone(); - + else if (!intermissionScreen) D_StartTitle(); }); } diff --git a/src/intermission/intermission.cpp b/src/intermission/intermission.cpp index 2cffde5005..cd4c0c32ed 100644 --- a/src/intermission/intermission.cpp +++ b/src/intermission/intermission.cpp @@ -872,9 +872,7 @@ again: } else if (action->mClass == TITLE_ID) { - Destroy(); - D_StartTitle (); - return false; + continue; } else { @@ -1011,13 +1009,21 @@ DIntermissionController* F_StartIntermission(FIntermissionDescriptor *desc, bool DIntermissionController* F_StartIntermission(FName seq) { FIntermissionDescriptor **pdesc = IntermissionDescriptors.CheckKey(seq); - if (pdesc == nullptr) + if (pdesc == nullptr || (*pdesc)->mActions.Size() == 0) { return nullptr; } else { - return F_StartIntermission(*pdesc, false); + auto desc = *pdesc; + auto action = desc->mActions[0]; + if (action->mClass == TITLE_ID) + { + // is handled elsewhere. + return nullptr; + } + + return F_StartIntermission(desc, false); } } diff --git a/wadsrc/static/mapinfo/common.txt b/wadsrc/static/mapinfo/common.txt index 397166cabe..6982a5bced 100644 --- a/wadsrc/static/mapinfo/common.txt +++ b/wadsrc/static/mapinfo/common.txt @@ -412,9 +412,6 @@ Intermission Inter_Underwater { Background = "E2END", 0 } - GotoTitle - { - } } Intermission Inter_Demonscroll