diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 9a60a7a0a..247b3e151 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1499,14 +1499,11 @@ static void SendNameAndColor(UINT8 n) if (!cv_followercolor[n].value) CV_StealthSet(&cv_followercolor[n], "Match"); // set it to "Match". I don't care about your stupidity! - // so like, this is sent before we even use anything like cvars or w/e so it's possible that follower is set to a pretty yikes value, so let's fix that before we send garbage that could crash the game: - if (cv_follower[n].value >= numfollowers || cv_follower[n].value < -1) - CV_StealthSet(&cv_follower[n], "None"); - if (!strcmp(cv_playername[n].string, player_names[playernum]) && cv_playercolor[n].value == player->skincolor - && !strcmp(cv_skin[n].string, skins[player->skin].name) - && cv_follower[n].value == player->followerskin + && !stricmp(cv_skin[n].string, skins[player->skin].name) + && !stricmp(cv_follower[n].string, + (player->followerskin < 0 ? "None" : followers[player->followerskin].name)) && cv_followercolor[n].value == player->followercolor) return; @@ -6060,6 +6057,7 @@ static void Name_OnChange(void) { CONS_Alert(CONS_NOTICE, M_GetText("You may not change your name when chat is muted.\n")); CV_StealthSet(&cv_playername[0], player_names[consoleplayer]); + return; } else SendNameAndColor(0); @@ -6169,7 +6167,9 @@ static void Skin_OnChange(void) } if (CanChangeSkinWhilePlaying(consoleplayer)) + { SendNameAndColor(0); + } else { CONS_Alert(CONS_NOTICE, M_GetText("You can't change your skin at the moment.\n")); diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 4c3b6c5c1..74135465d 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -1583,6 +1583,9 @@ void M_Ticker(void) { INT32 i; + if (!menuactive) + return; + if (menutransition.tics != 0 || menutransition.dest != 0) { noFurtherInput = true; @@ -3095,8 +3098,6 @@ static void M_MPConfirmCharacterSelection(void) for (i = 0; i < splitscreen +1; i++) { - char cmd[MAXSTRINGLENGTH]; - // colour // (convert the number that's saved to a string we can use) col = setup_player[i].color; @@ -3108,18 +3109,14 @@ static void M_MPConfirmCharacterSelection(void) else CV_StealthSet(&cv_follower[i], followers[setup_player[i].followern].name); - // follower color - CV_StealthSetValue(&cv_followercolor[i], setup_player[i].followercolor); - // finally, call the skin[x] console command. // This will call SendNameAndColor which will synch everything we sent here and apply the changes! - // This is a hack to make sure we call Skin[x]_OnChange afterwards - CV_StealthSetValue(&cv_skin[i], -1); + CV_StealthSet(&cv_skin[i], skins[setup_player[i].skin].name); - strcpy(cmd, cv_skin[i].name); - strcat(cmd, va(" %s", skins[setup_player[i].skin].name)); - COM_ImmedExecute(cmd); + // ...actually, let's do this last - Skin_OnChange has some return-early occasions + // follower color + CV_SetValue(&cv_followercolor[i], setup_player[i].followercolor); } M_ClearMenus(true);