diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index 7216b5567..1852c62e9 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -195,7 +195,6 @@ void initcrane(DDukeActor* actj, DDukeActor* acti, int CRANEPOLE); void initwaterdrip(DDukeActor* actj, DDukeActor* acti); int initreactor(DDukeActor* actj, DDukeActor* acti, bool isrecon); void spawneffector(DDukeActor* actor); -void gameexitfrommenu(); int startrts(int lumpNum, int localPlayer); void pickrandomspot(int pn); diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index 05908e7e2..d2674a558 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -84,27 +84,6 @@ GameStats GameInterface::getStats() // //--------------------------------------------------------------------------- -template -void runbonus(func completion) -{ - // MP scoreboard - if (playerswhenstarted > 1 && !ud.coop) - { - dobonus(1, completion); - } - else completion(false); - -} - -template -void runtwoscreens(func completion) -{ - // shareware and TEN screens - if (isShareware() && !isRR()) - showtwoscreens(completion); - else completion(false); -} - static void endthegame(bool) { endoomName = isRR() ? "redneck.bin" : !isShareware() ? "duke3d.bin" : "dukesw.bin"; @@ -112,14 +91,27 @@ static void endthegame(bool) } -void gameexitfrommenu() -{ - runbonus([](bool aborted) { runtwoscreens(endthegame); }); -} - void GameInterface::ExitFromMenu() { - gameexitfrommenu(); + auto runbonus = [=](auto completion) + { + // MP scoreboard + if (playerswhenstarted > 1 && !ud.coop) + { + dobonus(1, completion); + } + else completion(false); + }; + + auto runtwoscreens = [](auto completion) + { + // shareware and TEN screens + if (isShareware() && !isRR()) + showtwoscreens(completion); + else completion(false); + }; + + runbonus([=](bool aborted) { runtwoscreens(endthegame); }); } //---------------------------------------------------------------------------