From 033d87fbe162c176e018562df007962d05914732 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 13 Sep 2022 12:38:30 +0100 Subject: [PATCH] Adjust profile "guessing" - Remove block from using connect with uninitialised profile. Instead, CL_ConnectToServer handles the guess entirely. - Add splitscreen player initialisation in circumstances previously missing it --- src/d_clisrv.c | 33 ++++++--------------------------- src/d_main.c | 6 ++++++ src/g_game.c | 6 ++++++ 3 files changed, 18 insertions(+), 27 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 167003f2a..93a91a3ff 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2018,7 +2018,13 @@ static void CL_ConnectToServer(void) } if (cv_currprofile.value == -1) + { PR_ApplyProfilePretend(cv_ttlprofilen.value, 0); + for (i = 1; i < cv_splitplayers.value; i++) + { + PR_ApplyProfile(cv_lastprofile[i].value, i); + } + } if (gamestate == GS_INTERMISSION) Y_EndIntermission(); // clean up intermission graphics etc if (gamestate == GS_VOTING) @@ -2279,33 +2285,6 @@ static void Command_connect(void) CONS_Printf(M_GetText("You cannot connect while in a game. End this game first.\n")); return; } - else if (cv_currprofile.value == 0) - { - CONS_Printf(M_GetText("You cannot connect while using the Guest Profile. Use a Custom Profile to play Online.\n")); - return; - } - else if (cv_currprofile.value == -1) - { - // No profile set, we're attempting to connect from the title screen. (Discord RPC / connect command) - // Automatically apply the last profiles for every potential split player. - // Make sure Player 1's Profile ISN'T the guest profile even if we do that. - - UINT8 i; - - CONS_Printf(M_GetText("No Profile set, attempting to use last used Profiles...\n")); - - for (i = 0; i < cv_splitplayers.value; i++) - { - if (cv_lastprofile[i].value || i > 0) - PR_ApplyProfile(cv_lastprofile[i].value, i); - else - { - CONS_Printf(M_GetText("Player 1's last used Profile is the Guest Profile, which cannot be used to play Online.\n")); - return; - } - } - CONS_Printf(M_GetText("Profiles have been automatically set according to the last used Profiles.\n")); - } // modified game check: no longer handled // we don't request a restart unless the filelist differs diff --git a/src/d_main.c b/src/d_main.c index d7092a901..b24592d2d 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1784,6 +1784,12 @@ void D_SRB2Main(void) // Has to be done before anything else so skin, color, etc in command buffer has an affect. // ttlprofilen used because it's roughly equivalent in functionality - a QoL aid for quickly getting from startup to action PR_ApplyProfile(cv_ttlprofilen.value, 0); + { + for (i = 1; i < cv_splitplayers.value; i++) + { + PR_ApplyProfile(cv_lastprofile[i].value, i); + } + } // Do this here so if you run SRB2 with eg +timelimit 5, the time limit counts // as having been modified for the first game. diff --git a/src/g_game.c b/src/g_game.c index 61013cf6c..af163aea4 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1266,7 +1266,13 @@ void G_DoLoadLevel(boolean resetplayer) wipegamestate = -1; // force a wipe if (cv_currprofile.value == -1) + { PR_ApplyProfilePretend(cv_ttlprofilen.value, 0); + for (i = 1; i < cv_splitplayers.value; i++) + { + PR_ApplyProfile(cv_lastprofile[i].value, i); + } + } if (gamestate == GS_INTERMISSION) Y_EndIntermission(); if (gamestate == GS_VOTING)