From ce443712b267a17217ddbcc4c0a48d8d95e0c39d Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 17 Oct 2018 13:40:17 +0100 Subject: [PATCH] Some token efforts to make singleplayer mode (accessible only via `-warp` and `map mapxx -force`) not COMPLETELY broken. * Fixed the conditionals for `suicide` and `retry` commands - `suicide` is now allowed in singleplayer, and `retry` no longer checks your lives (for now). * Disable the "traditional" level reload method (which `retry` tried to use), since it was completely broken with the other changes we've made. Mapchanges only. * Made retries cause a mapchange, per the above. * Disable the last source of skincolor trampling in the game - loading a level while not netgame or record attacking. --- src/d_netcmd.c | 9 +++++---- src/g_game.c | 10 ++++++---- src/m_menu.c | 10 +++++----- src/p_setup.c | 2 +- src/r_things.c | 4 ++-- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 17ae1242..3bb9a0d6 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2388,11 +2388,12 @@ static void Command_Suicide(void) }*/ // Retry is quicker. Probably should force people to use it. - if (!(netgame || multiplayer)) + // nope, this is srb2kart - a complete retry is overkill + /*if (!(netgame || multiplayer)) { CONS_Printf(M_GetText("You can't use this in Single Player! Use \"retry\" instead.\n")); return; - } + }*/ SendNetXCmd(XD_SUICIDE, &buf, 4); } @@ -4792,10 +4793,10 @@ void Command_Retry_f(void) CONS_Printf(M_GetText("You must be in a level to use this.\n")); else if (netgame || multiplayer) CONS_Printf(M_GetText("This only works in single player.\n")); - else if (!&players[consoleplayer] || players[consoleplayer].lives <= 1) + /*else if (!&players[consoleplayer] || players[consoleplayer].lives <= 1) CONS_Printf(M_GetText("You can't retry without any lives remaining!\n")); else if (G_IsSpecialStage(gamemap)) - CONS_Printf(M_GetText("You can't retry special stages!\n")); + CONS_Printf(M_GetText("You can't retry special stages!\n"));*/ else { M_ClearMenus(true); diff --git a/src/g_game.c b/src/g_game.c index ee1ee053..c24590fd 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2100,10 +2100,12 @@ void G_Ticker(boolean run) G_ClearRetryFlag(); // Costs a life to retry ... unless the player in question is dead already. - if (G_GametypeUsesLives() && players[consoleplayer].playerstate == PST_LIVE) + /*if (G_GametypeUsesLives() && players[consoleplayer].playerstate == PST_LIVE) players[consoleplayer].lives -= 1; - G_DoReborn(consoleplayer); + G_DoReborn(consoleplayer);*/ + + D_MapChange(gamemap, gametype, cv_kartencore.value, true, 1, false, false); } for (i = 0; i < MAXPLAYERS; i++) @@ -2935,7 +2937,7 @@ void G_DoReborn(INT32 playernum) if (oldmo) G_ChangePlayerReferences(oldmo, players[playernum].mo); } - else if (countdowntimeup || (!multiplayer && gametype == GT_COOP)) + /*else if (countdowntimeup || (!multiplayer && !modeattacking)) { // reload the level from scratch if (countdowntimeup) @@ -3004,7 +3006,7 @@ void G_DoReborn(INT32 playernum) #ifdef HAVE_BLUA } #endif - } + }*/ else { // respawn at the start diff --git a/src/m_menu.c b/src/m_menu.c index 2f848a2a..8f3a5df6 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2865,18 +2865,18 @@ void M_StartControlPanel(void) } else if (!(netgame || multiplayer)) // Single Player { - if (gamestate != GS_LEVEL || ultimatemode) // intermission, so gray out stuff. + if (gamestate != GS_LEVEL /*|| ultimatemode*/) // intermission, so gray out stuff. { SPauseMenu[spause_pandora].status = (M_SecretUnlocked(SECRET_PANDORA)) ? (IT_GRAYEDOUT) : (IT_DISABLED); SPauseMenu[spause_retry].status = IT_GRAYEDOUT; } else { - INT32 numlives = 2; + //INT32 numlives = 2; SPauseMenu[spause_pandora].status = (M_SecretUnlocked(SECRET_PANDORA)) ? (IT_STRING | IT_CALL) : (IT_DISABLED); - if (&players[consoleplayer]) + /*if (&players[consoleplayer]) { numlives = players[consoleplayer].lives; if (players[consoleplayer].playerstate != PST_LIVE) @@ -2887,7 +2887,7 @@ void M_StartControlPanel(void) // for me to want to use the short if statement syntax if (numlives <= 1 || G_IsSpecialStage(gamemap)) SPauseMenu[spause_retry].status = (IT_GRAYEDOUT); - else + else*/ SPauseMenu[spause_retry].status = (IT_STRING | IT_CALL); } @@ -4962,7 +4962,7 @@ static void M_RetryResponse(INT32 ch) static void M_Retry(INT32 choice) { (void)choice; - M_StartMessage(M_GetText("Retry this act from the last starpost?\n\n(Press 'Y' to confirm)\n"),M_RetryResponse,MM_YESNO); + M_StartMessage(M_GetText("Start this race over?\n\n(Press 'Y' to confirm)\n"),M_RetryResponse,MM_YESNO); } static void M_SelectableClearMenus(INT32 choice) diff --git a/src/p_setup.c b/src/p_setup.c index a606dca0..7c593ec9 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2209,7 +2209,7 @@ static void P_LevelInitStuff(void) players[i].lives = cv_startinglives.value; } #else - players[i].lives = 1; + players[i].lives = 1; // SRB2Kart #endif players[i].realtime = countdown = countdown2 = 0; diff --git a/src/r_things.c b/src/r_things.c index 802b3235..a468f14d 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2699,7 +2699,7 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum) player->jumpfactor = skin->jumpfactor; - if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback || modeattacking)) + /*if (!(cv_debug || devparm) && !(netgame || multiplayer || demoplayback || modeattacking)) { if (playernum == consoleplayer) CV_StealthSetValue(&cv_playercolor, skin->prefcolor); @@ -2712,7 +2712,7 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum) player->skincolor = skin->prefcolor; if (player->mo) player->mo->color = player->skincolor; - } + }*/ if (player->mo) P_SetScale(player->mo, player->mo->scale);