Merge branch 'fix-extra-player-dedicated-server' into 'next'

Fix one too many player count on dedicated servers

See merge request STJr/SRB2!2247
This commit is contained in:
Logan Aerl Arias 2023-12-28 22:59:09 +00:00
commit 8c1cd73859

View file

@ -109,7 +109,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
netbuffer->u.serverinfo.leveltime = (tic_t)LONG(leveltime); netbuffer->u.serverinfo.leveltime = (tic_t)LONG(leveltime);
// Exclude bots from both counts // Exclude bots from both counts
netbuffer->u.serverinfo.numberofplayer = (UINT8)D_NumNodes(); netbuffer->u.serverinfo.numberofplayer = (UINT8)(D_NumNodes() - (dedicated ? 1 : 0));
netbuffer->u.serverinfo.maxplayer = (UINT8)(cv_maxplayers.value - D_NumBots()); netbuffer->u.serverinfo.maxplayer = (UINT8)(cv_maxplayers.value - D_NumBots());
netbuffer->u.serverinfo.refusereason = GetRefuseReason(node); netbuffer->u.serverinfo.refusereason = GetRefuseReason(node);