diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp index 4db80729a8..848c89403b 100644 --- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -725,7 +725,7 @@ void VehicleCargoList::InvalidateCache() * @return Amount of cargo actually reassigned. */ template -uint VehicleCargoList::Reassign(uint max_move, StationID) +uint VehicleCargoList::Reassign(uint max_move) { static_assert(Tfrom != MTA_TRANSFER && Tto != MTA_TRANSFER); static_assert(Tfrom - Tto == 1 || Tto - Tfrom == 1); @@ -739,11 +739,10 @@ uint VehicleCargoList::Reassign(uint max_move, StationID) * Reassign cargo from MTA_DELIVER to MTA_TRANSFER and take care of the next * station the cargo wants to visit. * @param max_move Maximum amount of cargo to reassign. - * @param next_station Station to record as next hop in the reassigned packets. * @return Amount of cargo actually reassigned. */ template<> -uint VehicleCargoList::Reassign(uint max_move, StationID next_station) +uint VehicleCargoList::Reassign(uint max_move) { max_move = std::min(this->action_counts[MTA_DELIVER], max_move); @@ -761,7 +760,7 @@ uint VehicleCargoList::Reassignnext_station = next_station; + cp->next_station = INVALID_STATION; } this->action_counts[MTA_DELIVER] -= max_move; @@ -1139,4 +1138,4 @@ uint StationCargoList::RerouteFromSource(uint max_move, StationCargoList *dest, */ template class CargoList; template class CargoList; -template uint VehicleCargoList::Reassign(uint, StationID); +template uint VehicleCargoList::Reassign(uint); diff --git a/src/cargopacket.h b/src/cargopacket.h index 4c667415e0..21deb8f12f 100644 --- a/src/cargopacket.h +++ b/src/cargopacket.h @@ -451,7 +451,7 @@ public: * applicable), return value is amount of cargo actually moved. */ template - uint Reassign(uint max_move, StationID update = INVALID_STATION); + uint Reassign(uint max_move); uint Return(uint max_move, StationCargoList *dest, StationID next_station); uint Unload(uint max_move, StationCargoList *dest, CargoPayment *payment); uint Shift(uint max_move, VehicleCargoList *dest); diff --git a/src/economy.cpp b/src/economy.cpp index a512c33f03..18d3ea4ce4 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -2089,7 +2089,7 @@ static void LoadUnloadVehicle(Vehicle *front) if (GetUnloadType(v) & (OUFB_TRANSFER | OUFB_UNLOAD)) { /* Transfer instead of delivering. */ v->cargo.Reassign( - v->cargo.ActionCount(VehicleCargoList::MTA_DELIVER), INVALID_STATION); + v->cargo.ActionCount(VehicleCargoList::MTA_DELIVER)); } else { uint new_remaining = v->cargo.RemainingCount() + v->cargo.ActionCount(VehicleCargoList::MTA_DELIVER); if (v->cargo_cap < new_remaining) {