summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
Diffstat (limited to 'src/network')
-rw-r--r--src/network/network_command.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/network_command.cpp b/src/network/network_command.cpp
index 8e1fa077b..d68021205 100644
--- a/src/network/network_command.cpp
+++ b/src/network/network_command.cpp
@@ -81,13 +81,16 @@ CommandPacket *CommandQueue::Pop(bool ignore_paused)
{
CommandPacket **prev = &this->first;
CommandPacket *ret = this->first;
+ CommandPacket *prev_item = NULL;
if (ignore_paused && _pause_mode != PM_UNPAUSED) {
while (ret != NULL && !IsCommandAllowedWhilePaused(ret->cmd)) {
+ prev_item = ret;
prev = &ret->next;
ret = ret->next;
}
}
if (ret != NULL) {
+ if (ret == this->last) this->last = prev_item;
*prev = ret->next;
this->count--;
}