From 7457a0b7a60c793fac0a9301029d1d8f713513d1 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 20 Feb 2024 20:51:35 +0000 Subject: [PATCH] Fix cb588d8d: Ordering of command per tick limit and pause mode filtering (#12126) The command per tick limit should be applied after the pause mode filter --- src/network/network_command.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp index 8512d37d20..189f198070 100644 --- a/src/network/network_command.cpp +++ b/src/network/network_command.cpp @@ -327,15 +327,15 @@ static void DistributeQueue(CommandQueue &queue, const NetworkClientSocket *owne /* Not technically the most performant way, but consider clients rarely click more than once per tick. */ for (auto cp = queue.begin(); cp != queue.end(); /* removing some items */) { - /* Limit the number of commands per client per tick. */ - if (--to_go < 0) break; - /* Do not distribute commands when paused and the command is not allowed while paused. */ if (_pause_mode != PM_UNPAUSED && !IsCommandAllowedWhilePaused(cp->cmd)) { ++cp; continue; } + /* Limit the number of commands per client per tick. */ + if (--to_go < 0) break; + DistributeCommandPacket(*cp, owner); NetworkAdminCmdLogging(owner, *cp); cp = queue.erase(cp);