diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 28b816b3a..99fcbded3 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -5304,7 +5304,6 @@ static void Follower_OnChange(void) { char str[SKINNAMESIZE+1], cpy[SKINNAMESIZE+1]; INT32 num; - char set[10]; // This isn't Lua and mixed declarations in the middle of code make caveman compilers scream. // there is a slight chance that we will actually use a string instead so... // let's investigate the string... @@ -5329,8 +5328,8 @@ static void Follower_OnChange(void) if (num == -1) // that's an error. CONS_Alert(CONS_WARNING, M_GetText("Follower '%s' not found\n"), str); - sprintf(set, "%d", num); - CV_StealthSet(&cv_follower[0], set); // set it to a number. It's easier for us to send later :) + CV_StealthSet(&cv_follower[0], str); + cv_follower[0].value = num; } if (!Playing()) @@ -5358,7 +5357,6 @@ static void Follower2_OnChange(void) { char str[SKINNAMESIZE+1], cpy[SKINNAMESIZE+1]; INT32 num; - char set[10]; // This isn't Lua and mixed declarations in the middle of code make caveman compilers scream. // there is a slight chance that we will actually use a string instead so... // let's investigate the string... @@ -5383,8 +5381,8 @@ static void Follower2_OnChange(void) if (num == -1) // that's an error. CONS_Alert(CONS_WARNING, M_GetText("Follower '%s' not found\n"), str); - sprintf(set, "%d", num); - CV_StealthSet(&cv_follower[1], set); // set it to a number. It's easier for us to send later :) + CV_StealthSet(&cv_follower[1], str); + cv_follower[1].value = num; } if (!Playing()) @@ -5409,7 +5407,6 @@ static void Follower3_OnChange(void) { char str[SKINNAMESIZE+1], cpy[SKINNAMESIZE+1]; INT32 num; - char set[10]; // This isn't Lua and mixed declarations in the middle of code make caveman compilers scream. // there is a slight chance that we will actually use a string instead so... // let's investigate the string... @@ -5434,8 +5431,8 @@ static void Follower3_OnChange(void) if (num == -1) // that's an error. CONS_Alert(CONS_WARNING, M_GetText("Follower '%s' not found\n"), str); - sprintf(set, "%d", num); - CV_StealthSet(&cv_follower[2], set); // set it to a number. It's easier for us to send later :) + CV_StealthSet(&cv_follower[2], str); + cv_follower[2].value = num; } if (!Playing()) @@ -5460,7 +5457,6 @@ static void Follower4_OnChange(void) { char str[SKINNAMESIZE+1], cpy[SKINNAMESIZE+1]; INT32 num; - char set[10]; // This isn't Lua and mixed declarations in the middle of code make caveman compilers scream. // there is a slight chance that we will actually use a string instead so... // let's investigate the string... @@ -5485,8 +5481,8 @@ static void Follower4_OnChange(void) if (num == -1) // that's an error. CONS_Alert(CONS_WARNING, M_GetText("Follower '%s' not found\n"), str); - sprintf(set, "%d", num); - CV_StealthSet(&cv_follower[3], set); // set it to a number. It's easier for us to send later :) + CV_StealthSet(&cv_follower[3], str); + cv_follower[3].value = num; } if (!Playing()) diff --git a/src/m_menu.c b/src/m_menu.c index dc753db68..b7299fc9b 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -9855,7 +9855,7 @@ static void M_SetupMultiPlayer(INT32 choice) setupm_cvname = &cv_playername[0]; setupm_cvfollower = &cv_follower[0]; - setupm_fakefollower = atoi(setupm_cvfollower->string); // update fake follower value + setupm_fakefollower = setupm_cvfollower->value; // yikes, we don't want none of that... if (setupm_fakefollower >= numfollowers) @@ -9898,7 +9898,7 @@ static void M_SetupMultiPlayer2(INT32 choice) setupm_cvname = &cv_playername[1]; setupm_cvfollower = &cv_follower[1]; - setupm_fakefollower = atoi(setupm_cvfollower->string); // update fake follower value + setupm_fakefollower = setupm_cvfollower->value; // yikes, we don't want none of that... if (setupm_fakefollower >= numfollowers) @@ -9941,7 +9941,7 @@ static void M_SetupMultiPlayer3(INT32 choice) setupm_cvname = &cv_playername[2]; setupm_cvfollower = &cv_follower[2]; - setupm_fakefollower = atoi(setupm_cvfollower->string); // update fake follower value + setupm_fakefollower = setupm_cvfollower->value; // yikes, we don't want none of that... if (setupm_fakefollower >= numfollowers) @@ -9984,7 +9984,7 @@ static void M_SetupMultiPlayer4(INT32 choice) setupm_cvname = &cv_playername[3]; setupm_cvfollower = &cv_follower[3]; - setupm_fakefollower = atoi(setupm_cvfollower->string); // update fake follower value + setupm_fakefollower = setupm_cvfollower->value; // yikes, we don't want none of that... if (setupm_fakefollower >= numfollowers) @@ -10014,6 +10014,8 @@ static void M_SetupMultiPlayer4(INT32 choice) static boolean M_QuitMultiPlayerMenu(void) { size_t l; + const char *followername = setupm_fakefollower == -1 ? + "None" : followers[setupm_fakefollower].skinname; // send name if changed if (strcmp(setupm_name, setupm_cvname->string)) { @@ -10026,7 +10028,7 @@ static boolean M_QuitMultiPlayerMenu(void) // you know what? always putting these in the buffer won't hurt anything. COM_BufAddText (va("%s \"%s\"\n",setupm_cvskin->name,skins[setupm_fakeskin].name)); COM_BufAddText (va("%s %d\n",setupm_cvcolor->name,setupm_fakecolor->color)); - COM_BufAddText (va("%s %d\n",setupm_cvfollower->name,setupm_fakefollower)); + COM_BufAddText (va("%s %s\n",setupm_cvfollower->name,followername)); return true; }