From 8ce9681bd884fef3d0601612adc92a588b05cf6c Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 28 Feb 2024 20:02:23 +0000 Subject: [PATCH] Got_TeamChange: Successfully remove PF_WANTSTOJOIN if you use `changeteam spectator` to cancel your join --- src/d_netcmd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index d960b66d8..67d3a13d2 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -5035,6 +5035,17 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) //Now that we've done our error checking and killed the player //if necessary, put the player on the correct team/status. + + // This serves us in both teamchange contexts. + if (NetPacket.packet.newteam != 0) + { + players[playernum].pflags |= PF_WANTSTOJOIN; + } + else + { + players[playernum].pflags &= ~PF_WANTSTOJOIN; + } + if (G_GametypeHasTeams()) { if (!NetPacket.packet.newteam)