Codechange: use std::vector for the outgoing command "queues"

This commit is contained in:
Rubidium
2024-02-04 16:23:44 +01:00
committed by rubidium42
parent 09a12f230f
commit b3aa8a9c35
3 changed files with 5 additions and 9 deletions

View File

@@ -304,9 +304,8 @@ void NetworkSendCommand(Commands cmd, StringID err_message, CommandCallback *cal
void NetworkSyncCommandQueue(NetworkClientSocket *cs)
{
for (CommandPacket *p = _local_execution_queue.Peek(); p != nullptr; p = p->next) {
CommandPacket c = *p;
CommandPacket &c = cs->outgoing_queue.emplace_back(*p);
c.callback = nullptr;
cs->outgoing_queue.Append(&c);
}
}
@@ -371,7 +370,7 @@ static void DistributeCommandPacket(CommandPacket &cp, const NetworkClientSocket
* first place. This filters that out. */
cp.callback = (cs != owner) ? nullptr : callback;
cp.my_cmd = (cs == owner);
cs->outgoing_queue.Append(&cp);
cs->outgoing_queue.push_back(cp);
}
}