From 9c17ea0d2821ca692aa1e7e70832a5695ab13dc4 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 18 Apr 2023 12:32:45 +0100 Subject: [PATCH] Got_MapQueuecmd: Fix message handling - Used Admin status of sender rather than local player to obstruct or hide - Servers are not admins, they just sidestep many authoriative checks - Server returned early before any chance of printing - Slightly cleaner message --- src/d_netcmd.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 59fddaf99..0f351c201 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3438,7 +3438,7 @@ static void Got_RequestMapQueuecmd(UINT8 **cp, INT32 playernum) static void Got_MapQueuecmd(UINT8 **cp, INT32 playernum) { - UINT8 flags, queueposition; + UINT8 flags, queueposition, i; boolean setencore; UINT16 setgametype; @@ -3464,21 +3464,28 @@ static void Got_MapQueuecmd(UINT8 **cp, INT32 playernum) return; } - if (server) - return; - - while (roundqueue.size <= queueposition) + if (!server) { - memset(&roundqueue.entries[roundqueue.size], 0, sizeof(roundentry_t)); - roundqueue.size++; + while (roundqueue.size <= queueposition) + { + memset(&roundqueue.entries[roundqueue.size], 0, sizeof(roundentry_t)); + roundqueue.size++; + } + + G_MapSlipIntoRoundQueue(queueposition, 0, setgametype, setencore, false); + + for (i = 0; i <= splitscreen; i++) + { + if (!IsPlayerAdmin(g_localplayers[i])) + continue; + break; + } + + if (i > splitscreen) + return; } - G_MapSlipIntoRoundQueue(queueposition, 0, setgametype, setencore, false); - - if (!IsPlayerAdmin(playernum)) - return; - - CONS_Printf("queuemap: A map was successfully added to the round queue (position %u)\n", queueposition); + CONS_Printf("queuemap: A map was added to the round queue (pos. %u)\n", queueposition+1); } static void Command_Pause(void)