From b24f173d03653d449301b6476a77c4ac563677e2 Mon Sep 17 00:00:00 2001 From: Edward Richardson Date: Tue, 23 Dec 2014 22:20:39 +1300 Subject: [PATCH] Allow players to be popped in packet-server --- src/d_net.cpp | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/src/d_net.cpp b/src/d_net.cpp index 02ca8c0c4d..4f56a32a9d 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -669,25 +669,38 @@ void PlayerIsGone (int netnode, int netconsole) { int i; - if (!nodeingame[netnode]) - return; + if (nodeingame[netnode]) + { + for (i = netnode + 1; i < doomcom.numnodes; ++i) + { + if (nodeingame[i]) + break; + } + if (i == doomcom.numnodes) + { + doomcom.numnodes = netnode; + } - for (i = netnode + 1; i < doomcom.numnodes; ++i) - { - if (nodeingame[i]) - break; + if (playeringame[netconsole]) + { + players[netconsole].playerstate = PST_GONE; + } + nodeingame[netnode] = false; + nodejustleft[netnode] = false; } - if (i == doomcom.numnodes) + else if (nodejustleft[netnode]) // Packet Server { - doomcom.numnodes = netnode; + if (netnode + 1 == doomcom.numnodes) + { + doomcom.numnodes = netnode; + } + if (playeringame[netconsole]) + { + players[netconsole].playerstate = PST_GONE; + } + nodejustleft[netnode] = false; } - - if (playeringame[netconsole]) - { - players[netconsole].playerstate = PST_GONE; - } - nodeingame[netnode] = false; - nodejustleft[netnode] = false; + else return; if (netconsole == Net_Arbitrator) { @@ -790,7 +803,6 @@ void GetPackets (void) else { nodeingame[netnode] = false; - playeringame[netconsole] = false; nodejustleft[netnode] = true; } continue;