(svn r26330) -Fix: the theoretical case of rerouting cargo from one VehicleCargoList to another.

replace/41b28d7194a279bdc17475d4fbe2ea6ec885a466
fonsinchen 10 years ago
parent 4f24e33548
commit 82ece7db12

@ -224,8 +224,7 @@ bool VehicleCargoReroute::operator()(CargoPacket *cp)
}
if (this->source != this->destination) {
this->source->RemoveFromMeta(cp_new, VehicleCargoList::MTA_TRANSFER, cp_new->Count());
this->source->AddToMeta(cp_new, VehicleCargoList::MTA_TRANSFER);
this->destination->action_counts[VehicleCargoList::MTA_TRANSFER] += cp_new->Count();
this->destination->AddToMeta(cp_new, VehicleCargoList::MTA_TRANSFER);
}
/* Legal, as front pushing doesn't invalidate iterators in std::list. */

Loading…
Cancel
Save