diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg index ce1979581fb7e1251ad76882154eab80ec204f06..1b3343c9c52933db11df755905907f6876ab4795 100644 --- a/extras/conf/udb/Includes/SRB222_linedefs.cfg +++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg @@ -125,6 +125,7 @@ udmf { 1 = "Skip score tally"; 2 = "Check emeralds"; + 4 = "Keep post level cutscene if score tally is skipped"; } } arg2 diff --git a/src/doomstat.h b/src/doomstat.h index b5b2984407cc7cf03d213de8cb70f3bab720fc88..a996941862d53b30e1cea4475a818e9db29a969d 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -249,6 +249,7 @@ extern textprompt_t *textprompts[MAX_PROMPTS]; // For the Custom Exit linedef. extern INT16 nextmapoverride; extern UINT8 skipstats; +extern boolean keepcutscene; extern INT16 nextgametype; extern UINT32 ssspheres; // Total # of spheres in a level diff --git a/src/g_game.c b/src/g_game.c index 1c186ae03149780b254c72f5243ed3d551350e52..ea4cdaf539663e01ac9925b8e974eea7f286a057 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -162,6 +162,8 @@ INT16 nextmapoverride; UINT8 skipstats; INT16 nextgametype = -1; +boolean keepcutscene; + // Pointers to each CTF flag mobj_t *redflag; mobj_t *blueflag; @@ -3159,6 +3161,7 @@ void G_DoReborn(INT32 playernum) nextmapoverride = gamemap; countdown2 = TICRATE; skipstats = 2; + keepcutscene = 0; for (i = 0; i < MAXPLAYERS; i++) { @@ -4209,7 +4212,7 @@ void G_AfterIntermission(void) if ((gametyperules & GTR_CUTSCENES) && mapheaderinfo[gamemap-1]->cutscenenum && !modeattacking - && skipstats <= 1 + && (skipstats <= 1 || keepcutscene == true) && (gamecomplete || !(marathonmode & MA_NOCUTSCENES)) && stagefailed == false) { diff --git a/src/lua_baselib.c b/src/lua_baselib.c index ecd1ee55e648019fb883917ca361cc45ba8847b2..211336c8cb310839209b81be88a230fff29c974b 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -4171,21 +4171,26 @@ static int lib_gSetCustomExitVars(lua_State *L) // LUA EXTENSION: Custom exit like support // Supported: - // G_SetCustomExitVars(); [reset to defaults] - // G_SetCustomExitVars(int) [nextmap override only] - // G_SetCustomExitVars(nil, int) [skipstats only] - // G_SetCustomExitVars(int, int) [both of the above] - // G_SetCustomExitVars(int, int, int) [nextmapoverride, skipstats and nextgametype] + // G_SetCustomExitVars(); [reset to defaults] + // G_SetCustomExitVars(int) [nextmap override only] + // G_SetCustomExitVars(nil, int) [skipstats only] + // G_SetCustomExitVars(int, int) [both of the above] + // G_SetCustomExitVars(int, int, int) [nextmapoverride, skipstats and nextgametype] + // G_SetCustomExitVars(int, int, int, int) [nextmapoverride, skipstats, nextgametype and keepcutscenes] nextmapoverride = 0; skipstats = 0; nextgametype = -1; + keepcutscene = false; if (n >= 1) { nextmapoverride = (INT16)luaL_optinteger(L, 1, 0); skipstats = (INT16)luaL_optinteger(L, 2, 0); nextgametype = (INT16)luaL_optinteger(L, 3, -1); + + if (!lua_isnil(L, 4)) + keepcutscene = luaL_checkboolean(L, 4); } return 0; diff --git a/src/lua_script.c b/src/lua_script.c index 686555a16d6b09b98d839cefec0ac0fc876181ae..adf095d593c3d1500fe147f2640ccb5f93061394 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -274,6 +274,18 @@ int LUA_PushGlobals(lua_State *L, const char *word) } else if (fastcmp(word,"tutorialmode")) { lua_pushboolean(L, tutorialmode); return 1; + } else if (fastcmp(word,"keepcutscene")) { + lua_pushboolean(L, keepcutscene); + return 1; + } else if (fastcmp(word,"nextgametype")) { + lua_pushinteger(L, nextgametype); + return 1; + } else if (fastcmp(word,"skipstats")) { + lua_pushinteger(L, skipstats); + return 1; + } else if (fastcmp(word,"nextmapoverride")) { + lua_pushinteger(L, nextmapoverride); + return 1; // end map vars // begin CTF colors } else if (fastcmp(word,"skincolor_redteam")) { diff --git a/src/p_setup.c b/src/p_setup.c index c2b8f2db2e367cc23fcdb704f23fe572360eea81..296ebbf0acaf51d6d1bd34eb3082ed6fc33824db 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -8120,6 +8120,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate) R_PrecacheLevel(); nextmapoverride = 0; + keepcutscene = false; skipstats = 0; levelloading = false; diff --git a/src/p_spec.c b/src/p_spec.c index 93809cbb4b68118e4fc4032186c5e772435daba2..ddc97831e3b816a1f147786932aca5cdbc8d2898 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -4573,6 +4573,10 @@ static void P_ProcessExitSector(player_t *player, mtag_t sectag) if (lines[lineindex].args[1] & TMEF_SKIPTALLY) skipstats = 1; + + //skip stats actually skips post-level cutscenes. + if (lines[lineindex].args[1] & TMEF_KEEPCUTSCENE) + keepcutscene = true; } static void P_ProcessTeamBase(player_t *player, boolean redteam) diff --git a/src/p_spec.h b/src/p_spec.h index ba08781b636cdb0042368c5ff90b5fa0db8c193c..7fd99ac65c38a551f7f8ae6119586bcfdc05090b 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -130,6 +130,7 @@ typedef enum { TMEF_SKIPTALLY = 1, TMEF_EMERALDCHECK = 1<<1, + TMEF_KEEPCUTSCENE = 1<<2, } textmapexitflags_t; typedef enum