diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp index 2c93d8c85f..8bd6b651d2 100644 --- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -218,7 +218,7 @@ void CargoList::Truncate(uint max_remaining) CargoPacket *cp = *it; if (max_remaining == 0) { /* Nothing should remain, just remove the packets. */ - this->packets.erase(it++); + it = this->packets.erase(it); static_cast(this)->RemoveFromCache(cp); delete cp; continue; @@ -278,7 +278,7 @@ bool CargoList::MoveTo(Tother_inst *dest, uint max_move, MoveToAction mta if (cp->count <= max_move) { /* Can move the complete packet */ max_move -= cp->count; - this->packets.erase(it++); + it = this->packets.erase(it); static_cast(this)->RemoveFromCache(cp); switch (mta) { case MTA_FINAL_DELIVERY: