Use follower name in cv_follower

This commit is contained in:
James R 2022-06-07 01:48:26 -07:00
parent 30f60585be
commit d299afbb2a
2 changed files with 15 additions and 17 deletions

View file

@ -5302,7 +5302,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...
@ -5327,8 +5326,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())
@ -5356,7 +5355,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...
@ -5381,8 +5379,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())
@ -5407,7 +5405,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...
@ -5432,8 +5429,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())
@ -5458,7 +5455,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...
@ -5483,8 +5479,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())

View file

@ -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;
}