mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-15 01:01:33 +00:00
Merge branch 'fix-softlock-empty-name' into 'next'
Fix softlocking as Sonic & Tails when Player 2 has no name See merge request STJr/SRB2!2056
This commit is contained in:
commit
f67aea7fc2
1 changed files with 7 additions and 1 deletions
|
@ -1295,6 +1295,7 @@ static boolean CL_AskFileList(INT32 firstfile)
|
|||
static boolean CL_SendJoin(void)
|
||||
{
|
||||
UINT8 localplayers = 1;
|
||||
char const *player2name;
|
||||
if (netgame)
|
||||
CONS_Printf(M_GetText("Sending join request...\n"));
|
||||
netbuffer->packettype = PT_CLIENTJOIN;
|
||||
|
@ -1311,9 +1312,14 @@ static boolean CL_SendJoin(void)
|
|||
CleanupPlayerName(consoleplayer, cv_playername.zstring);
|
||||
if (splitscreen)
|
||||
CleanupPlayerName(1, cv_playername2.zstring);/* 1 is a HACK? oh no */
|
||||
// Avoid empty string on bots to avoid softlocking in singleplayer
|
||||
if (botingame)
|
||||
player2name = strcmp(cv_playername.zstring, "Tails") == 0 ? "Tail" : "Tails";
|
||||
else
|
||||
player2name = cv_playername2.zstring;
|
||||
|
||||
strncpy(netbuffer->u.clientcfg.names[0], cv_playername.zstring, MAXPLAYERNAME);
|
||||
strncpy(netbuffer->u.clientcfg.names[1], cv_playername2.zstring, MAXPLAYERNAME);
|
||||
strncpy(netbuffer->u.clientcfg.names[1], player2name, MAXPLAYERNAME);
|
||||
|
||||
return HSendPacket(servernode, true, 0, sizeof (clientconfig_pak));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue