Fix pickedchar not being set when it should have been

This commit is contained in:
Lactozilla 2023-10-31 04:04:01 -03:00
parent cec5338f7c
commit 4e446d22d6
3 changed files with 13 additions and 4 deletions

View file

@ -1614,6 +1614,9 @@ void D_SRB2Main(void)
if (D_CheckNetGame()) if (D_CheckNetGame())
autostart = true; autostart = true;
if (!dedicated)
pickedchar = R_SkinAvailable(cv_defaultskin.string);
// check for a driver that wants intermission stats // check for a driver that wants intermission stats
// start the apropriate game based on parms // start the apropriate game based on parms
if (M_CheckParm("-metal")) if (M_CheckParm("-metal"))
@ -1627,8 +1630,6 @@ void D_SRB2Main(void)
autostart = true; autostart = true;
} }
pickedchar = R_SkinAvailable(cv_defaultskin.string);
// user settings come before "+" parameters. // user settings come before "+" parameters.
if (dedicated) if (dedicated)
COM_ImmedExecute(va("exec \"%s"PATHSEP"adedserv.cfg\"\n", srb2home)); COM_ImmedExecute(va("exec \"%s"PATHSEP"adedserv.cfg\"\n", srb2home));

View file

@ -1492,8 +1492,12 @@ void G_BeginRecording(void)
demo_p += 16; demo_p += 16;
// Skin // Skin
for (i = 0; i < 16 && cv_skin.string[i]; i++) const char *skinname = cv_skin.string;
name[i] = cv_skin.string[i]; if (pickedchar >= 0 && pickedchar < numskins)
skinname = skins[pickedchar].name;
for (i = 0; i < 16 && skinname[i]; i++)
name[i] = skinname[i];
for (; i < 16; i++) for (; i < 16; i++)
name[i] = '\0'; name[i] = '\0';
M_Memcpy(demo_p,name,16); M_Memcpy(demo_p,name,16);

View file

@ -10372,6 +10372,8 @@ static void M_ChooseNightsAttack(INT32 choice)
sprintf(gpath,"replay"PATHSEP"%s"PATHSEP"%s", timeattackfolder, G_BuildMapName(cv_nextmap.value)); sprintf(gpath,"replay"PATHSEP"%s"PATHSEP"%s", timeattackfolder, G_BuildMapName(cv_nextmap.value));
snprintf(nameofdemo, sizeof nameofdemo, "%s-%s-last", gpath, skins[cv_chooseskin.value-1].name); snprintf(nameofdemo, sizeof nameofdemo, "%s-%s-last", gpath, skins[cv_chooseskin.value-1].name);
pickedchar = cv_chooseskin.value-1;
if (!cv_autorecord.value) if (!cv_autorecord.value)
remove(va("%s"PATHSEP"%s.lmp", srb2home, nameofdemo)); remove(va("%s"PATHSEP"%s.lmp", srb2home, nameofdemo));
else else
@ -10401,6 +10403,8 @@ static void M_ChooseTimeAttack(INT32 choice)
sprintf(gpath,"replay"PATHSEP"%s"PATHSEP"%s", timeattackfolder, G_BuildMapName(cv_nextmap.value)); sprintf(gpath,"replay"PATHSEP"%s"PATHSEP"%s", timeattackfolder, G_BuildMapName(cv_nextmap.value));
snprintf(nameofdemo, sizeof nameofdemo, "%s-%s-last", gpath, skins[cv_chooseskin.value-1].name); snprintf(nameofdemo, sizeof nameofdemo, "%s-%s-last", gpath, skins[cv_chooseskin.value-1].name);
pickedchar = cv_chooseskin.value-1;
if (!cv_autorecord.value) if (!cv_autorecord.value)
remove(va("%s"PATHSEP"%s.lmp", srb2home, nameofdemo)); remove(va("%s"PATHSEP"%s.lmp", srb2home, nameofdemo));
else else