@@ -324,21 +324,21 @@ static void DistributeQueue(CommandQueue
to_go = std::max<int>(to_go, _settings_client.network.commands_per_frame_server);
}
#endif
/* 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;
DistributeCommandPacket(*cp, owner);
NetworkAdminCmdLogging(owner, *cp);
cp = queue.erase(cp);
Status change: