From 3d383f209eff6e0525963c7fb4e740db9f5b467f Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 22 Jul 2023 14:37:34 +0100 Subject: [PATCH] Got_TeamChange: Applying PF_WANTSTOJOIN is NOT a playstate change --- src/d_netcmd.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 7f1042f8c..4a53e4159 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -4076,6 +4076,8 @@ 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. + boolean nochangeoccourred = false; + if (G_GametypeHasTeams()) { if (!NetPacket.packet.newteam) @@ -4087,6 +4089,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) { players[playernum].ctfteam = NetPacket.packet.newteam; players[playernum].pflags |= PF_WANTSTOJOIN; //players[playernum].spectator = false; + nochangeoccourred = true; } } else if (G_GametypeHasSpectators()) @@ -4094,7 +4097,10 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) if (!NetPacket.packet.newteam) players[playernum].spectator = true; else + { players[playernum].pflags |= PF_WANTSTOJOIN; //players[playernum].spectator = false; + nochangeoccourred = true; + } } if (NetPacket.packet.autobalance) @@ -4135,7 +4141,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) } }*/ - if (gamestate != GS_LEVEL) + if (gamestate != GS_LEVEL || nochangeoccourred == true) return; FinalisePlaystateChange(playernum);