From 8e6ecb5e98b1f9d521c29f7d371f4b3d781c604a Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 7 Nov 2018 21:42:10 +0000 Subject: [PATCH] * 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.) --- src/f_finale.c | 2 +- src/m_menu.c | 18 +++++++++++------- src/m_menu.h | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 60a4e396..e3920b46 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -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 diff --git a/src/m_menu.c b/src/m_menu.c index d96c8faf..64668d72 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -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); } } diff --git a/src/m_menu.h b/src/m_menu.h index d9770711..dc99e6bb 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -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;