mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 09:11:48 +00:00
Move splitscreen code path out of SetSkinLocal and into SendNameAndColor
This commit is contained in:
parent
a745997243
commit
8d56a4d32e
2 changed files with 13 additions and 10 deletions
|
@ -981,6 +981,7 @@ void D_StartTitle(void)
|
|||
emeralds = 0;
|
||||
memset(&luabanks, 0, sizeof(luabanks));
|
||||
lastmaploaded = 0;
|
||||
pickedchar = R_SkinAvailable(cv_defaultskin.string);
|
||||
|
||||
// In case someone exits out at the same time they start a time attack run,
|
||||
// reset modeattacking
|
||||
|
@ -1626,6 +1627,8 @@ void D_SRB2Main(void)
|
|||
autostart = true;
|
||||
}
|
||||
|
||||
pickedchar = R_SkinAvailable(cv_defaultskin.string);
|
||||
|
||||
// user settings come before "+" parameters.
|
||||
if (dedicated)
|
||||
COM_ImmedExecute(va("exec \"%s"PATHSEP"adedserv.cfg\"\n", srb2home));
|
||||
|
|
|
@ -1230,17 +1230,13 @@ static void SetSkinLocal(INT32 skinnum)
|
|||
{
|
||||
// Starring Metal Sonic as themselves, obviously.
|
||||
SetPlayerSkinByNum(consoleplayer, 5);
|
||||
return;
|
||||
}
|
||||
else if (splitscreen)
|
||||
{
|
||||
INT32 foundskin = R_SkinAvailable(cv_skin.string);
|
||||
if (foundskin != -1 && R_SkinUsable(consoleplayer, foundskin))
|
||||
SetPlayerSkinByNum(consoleplayer, foundskin);
|
||||
|
||||
if (skinnum != -1 && R_SkinUsable(consoleplayer, skinnum))
|
||||
SetPlayerSkinByNum(consoleplayer, skinnum);
|
||||
else
|
||||
SetPlayerSkinByNum(consoleplayer, GetPlayerDefaultSkin(consoleplayer));
|
||||
}
|
||||
else
|
||||
SetPlayerSkinByNum(consoleplayer, skinnum);
|
||||
}
|
||||
|
||||
static void SetColorLocal(void)
|
||||
|
@ -1294,6 +1290,10 @@ static void SendNameAndColor(void)
|
|||
strcpy(player_names[consoleplayer], cv_playername.zstring);
|
||||
|
||||
SetColorLocal();
|
||||
|
||||
if (splitscreen)
|
||||
SetSkinLocal(R_SkinAvailable(cv_skin.string));
|
||||
else
|
||||
SetSkinLocal(pickedchar);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue