mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-10 08:00:05 +00:00
The command per tick limit should be applied after the pause mode filter
This commit is contained in:
parent
ad9080338c
commit
c637d376d0
@ -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. */
|
/* 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 */) {
|
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. */
|
/* Do not distribute commands when paused and the command is not allowed while paused. */
|
||||||
if (_pause_mode != PM_UNPAUSED && !IsCommandAllowedWhilePaused(cp->cmd)) {
|
if (_pause_mode != PM_UNPAUSED && !IsCommandAllowedWhilePaused(cp->cmd)) {
|
||||||
++cp;
|
++cp;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Limit the number of commands per client per tick. */
|
||||||
|
if (--to_go < 0) break;
|
||||||
|
|
||||||
DistributeCommandPacket(*cp, owner);
|
DistributeCommandPacket(*cp, owner);
|
||||||
NetworkAdminCmdLogging(owner, *cp);
|
NetworkAdminCmdLogging(owner, *cp);
|
||||||
cp = queue.erase(cp);
|
cp = queue.erase(cp);
|
||||||
|
Loading…
Reference in New Issue
Block a user