Show non-default lap count on replay screen too

This commit is contained in:
fickleheart 2019-04-01 12:56:23 -05:00
parent 4b9562f72f
commit b3ef039d87
3 changed files with 6 additions and 7 deletions

View file

@ -6679,16 +6679,11 @@ void G_LoadDemoInfo(menudemo_t *pdemo)
if (netid == cv_kartspeed.netid) if (netid == cv_kartspeed.netid)
{ {
for (cvarcount = 0; kartspeed_cons_t[cvarcount].strvalue; cvarcount++) for (cvarcount = 0; kartspeed_cons_t[cvarcount].strvalue; cvarcount++)
{
if (!stricmp(kartspeed_cons_t[cvarcount].strvalue, svalue)) if (!stricmp(kartspeed_cons_t[cvarcount].strvalue, svalue))
{
pdemo->kartspeed = kartspeed_cons_t[cvarcount].value; pdemo->kartspeed = kartspeed_cons_t[cvarcount].value;
break;
}
}
break;
} }
else if (netid == cv_basenumlaps.netid && pdemo->gametype == GT_RACE)
pdemo->numlaps = atoi(svalue);
} }
if (pdemoflags & DF_ENCORE) if (pdemoflags & DF_ENCORE)

View file

@ -79,6 +79,7 @@ typedef struct menudemo_s {
UINT8 addonstatus; // What do we need to do addon-wise to play this demo? UINT8 addonstatus; // What do we need to do addon-wise to play this demo?
UINT8 gametype; UINT8 gametype;
UINT8 kartspeed; // Add OR DF_ENCORE for encore mode, idk UINT8 kartspeed; // Add OR DF_ENCORE for encore mode, idk
UINT8 numlaps;
char winnername[17]; char winnername[17];
UINT8 winnerskin, winnercolor; UINT8 winnerskin, winnercolor;

View file

@ -5300,6 +5300,9 @@ static void DrawReplayHutReplayInfo(void)
else else
V_DrawString(x, y, V_ALLOWLOWERCASE|V_TRANSLUCENT, "Level is not loaded."); V_DrawString(x, y, V_ALLOWLOWERCASE|V_TRANSLUCENT, "Level is not loaded.");
if (demolist[dir_on[menudepthleft]].numlaps)
V_DrawThinString(x, y+9, V_ALLOWLOWERCASE, va("(%d laps)", demolist[dir_on[menudepthleft]].numlaps));
V_DrawString(x, y+20, V_ALLOWLOWERCASE, demolist[dir_on[menudepthleft]].gametype == GT_RACE ? V_DrawString(x, y+20, V_ALLOWLOWERCASE, demolist[dir_on[menudepthleft]].gametype == GT_RACE ?
va("Race (%s speed)", kartspeed_cons_t[demolist[dir_on[menudepthleft]].kartspeed & ~DF_ENCORE].strvalue) : va("Race (%s speed)", kartspeed_cons_t[demolist[dir_on[menudepthleft]].kartspeed & ~DF_ENCORE].strvalue) :
"Battle Mode"); "Battle Mode");