* Add numbers to the staff name strings as Sryder requested.

* Make the maximum number of staff ghosts 99 instead of 100. It's a minor thing, and insignificant in the grand scheme of things, but it fixes a bugbear I haven't been able to get out of my head since originally starting to maintain this code. (In the case of 100, it'd do S00, which'd have some fucky effects on ordering. If we WANTED to start with S00, we shoulda used that slot in the first place.)
This commit is contained in:
toaster 2018-11-07 21:42:10 +00:00
parent cf16959ad5
commit 8e6ecb5e98
3 changed files with 13 additions and 9 deletions

View File

@ -1034,7 +1034,7 @@ void F_TitleScreenTicker(boolean run)
mapname = G_BuildMapName(G_RandMap(TOL_RACE, -2, false, false, 0, false)+1);
numstaff = 1;
while (numstaff < 100 && (l = W_CheckNumForName(va("%sS%02u",mapname,numstaff+1))) != LUMPERROR)
while (numstaff < 99 && (l = W_CheckNumForName(va("%sS%02u",mapname,numstaff+1))) != LUMPERROR)
numstaff++;
#if 0 // turns out this isn't how we're gonna organise 'em

View File

@ -2033,7 +2033,6 @@ static void Nextmap_OnChange(void)
{
char *leveltitle;
UINT8 active;
lumpnum_t l;
// Update the string in the consvar.
Z_Free(cv_nextmap.zstring);
@ -2093,15 +2092,14 @@ static void Nextmap_OnChange(void)
SP_GhostMenu[3].status = IT_STRING|IT_CVAR;
active |= 3;
}
if ((l = W_CheckNumForName(va("%sS01",G_BuildMapName(cv_nextmap.value)))) != LUMPERROR)
CV_SetValue(&cv_dummystaff, 1);
if (cv_dummystaff.value)
{
SP_ReplayMenu[4].status = IT_WHITESTRING|IT_KEYHANDLER;
SP_GhostMenu[4].status = IT_STRING|IT_CVAR;
CV_StealthSetValue(&cv_dummystaff, 1);
active |= 1;
dummystaffname[0] = '\0';
G_UpdateStaffGhostName(l);
}
if (active) {
@ -2149,7 +2147,7 @@ static void Dummymenuplayer_OnChange(void)
}
}*/
char dummystaffname[17];
char dummystaffname[22];
static void Dummystaff_OnChange(void)
{
@ -2164,8 +2162,9 @@ static void Dummystaff_OnChange(void)
}
else
{
char *temp = dummystaffname;
UINT8 numstaff = 1;
while (numstaff < 100 && (l = W_CheckNumForName(va("%sS%02u",G_BuildMapName(cv_nextmap.value),numstaff+1))) != LUMPERROR)
while (numstaff < 99 && (l = W_CheckNumForName(va("%sS%02u",G_BuildMapName(cv_nextmap.value),numstaff+1))) != LUMPERROR)
numstaff++;
if (cv_dummystaff.value < 1)
@ -2177,6 +2176,11 @@ static void Dummystaff_OnChange(void)
return; // shouldn't happen but might as well check...
G_UpdateStaffGhostName(l);
while (*temp)
temp++;
sprintf(temp, " - %d", cv_dummystaff.value);
}
}

View File

@ -211,7 +211,7 @@ extern description_t description[32];
extern consvar_t cv_newgametype, cv_nextmap, cv_chooseskin, cv_serversort;
extern CV_PossibleValue_t gametype_cons_t[];
extern char dummystaffname[17];
extern char dummystaffname[22];
extern INT16 startmap;
extern INT32 ultimate_selectable;