diff --git a/src/d_clisrv.c b/src/d_clisrv.c index fac79bcab..1e342a39f 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -3738,8 +3738,6 @@ static void Got_AddPlayer(const UINT8 **p, INT32 playernum) CONS_Debug(DBG_NETPLAY, "addplayer: %d %d\n", node, newplayernum); - //G_SpectatePlayerOnJoin(newplayernum); -- caused desyncs in this spot :( - if (newplayernum+1 > doomcom->numslots) doomcom->numslots = (INT16)(newplayernum+1); @@ -3755,6 +3753,13 @@ static void Got_AddPlayer(const UINT8 **p, INT32 playernum) G_AddPlayer(newplayernum, console); memcpy(players[newplayernum].public_key, public_key, PUBKEYLENGTH); + // Previously called at the top of this function, commented as + // "caused desyncs in this spot :(". But we can't do this in + // G_PlayerReborn, since that only runs for level contexts and + // allows people to party-crash the vote screen even when + // maxplayers is too low for them. Let's try it here...? + G_SpectatePlayerOnJoin(newplayernum); + for (i = 0; i < MAXAVAILABILITY; i++) { newplayer->availabilities[i] = READUINT8(*p); diff --git a/src/g_game.c b/src/g_game.c index 4909e9bd2..bd3acb7f0 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2313,7 +2313,8 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps) jointime = players[player].jointime; if (jointime <= 1) { - G_SpectatePlayerOnJoin(player); + // Now called in Got_AddPlayer. In case of weirdness, break glass. + // G_SpectatePlayerOnJoin(player); betweenmaps = true; }