Fix VehicleCargoList::Truncate when not all cargo is MTA_KEEP.

This commit is contained in:
Jonathan G Rennison
2016-02-25 18:39:04 +00:00
parent 6992312702
commit 495aa729df

View File

@@ -658,6 +658,7 @@ uint VehicleCargoList::Unload(uint max_move, StationCargoList *dest, CargoPaymen
uint VehicleCargoList::Truncate(uint max_move) uint VehicleCargoList::Truncate(uint max_move)
{ {
max_move = min(this->count, max_move); max_move = min(this->count, max_move);
if (max_move > this->ActionCount(MTA_KEEP)) this->KeepAll();
this->PopCargo(CargoRemoval<VehicleCargoList>(this, max_move)); this->PopCargo(CargoRemoval<VehicleCargoList>(this, max_move));
return max_move; return max_move;
} }