|
|
|
@ -133,7 +133,7 @@ CargoPacket::CargoPacket(StationID first_station, TileIndex source_xy, uint16 co
|
|
|
|
|
* @param count Number of cargo entities to put in this packet.
|
|
|
|
|
* @param periods_in_transit Number of cargo aging periods the cargo has been in transit.
|
|
|
|
|
* @param first_station Station the cargo was initially loaded.
|
|
|
|
|
* @param next_station Next station the cargo wants to go.
|
|
|
|
|
* @param next_hop Next station the cargo wants to go.
|
|
|
|
|
* @param source_xy Station location the cargo was initially loaded.
|
|
|
|
|
* @param feeder_share Feeder share the packet has already accumulated.
|
|
|
|
|
* @param source_type 'Type' of source the packet comes from (for subsidies).
|
|
|
|
@ -141,7 +141,7 @@ CargoPacket::CargoPacket(StationID first_station, TileIndex source_xy, uint16 co
|
|
|
|
|
* @note We have to zero memory ourselves here because we are using a 'new'
|
|
|
|
|
* that, in contrary to all other pools, does not memset to 0.
|
|
|
|
|
*/
|
|
|
|
|
CargoPacket::CargoPacket(uint16_t count, uint16_t periods_in_transit, StationID first_station, StationID next_station, TileIndex source_xy, Money feeder_share, SourceType source_type, SourceID source_id) :
|
|
|
|
|
CargoPacket::CargoPacket(uint16_t count, uint16_t periods_in_transit, StationID first_station, StationID next_hop, TileIndex source_xy, Money feeder_share, SourceType source_type, SourceID source_id) :
|
|
|
|
|
count(count),
|
|
|
|
|
periods_in_transit(periods_in_transit),
|
|
|
|
|
feeder_share(feeder_share),
|
|
|
|
@ -149,7 +149,7 @@ CargoPacket::CargoPacket(uint16_t count, uint16_t periods_in_transit, StationID
|
|
|
|
|
source_id(source_id),
|
|
|
|
|
source_type(source_type),
|
|
|
|
|
first_station(first_station),
|
|
|
|
|
next_station(next_station)
|
|
|
|
|
next_hop(next_hop)
|
|
|
|
|
{
|
|
|
|
|
dbg_assert(count != 0);
|
|
|
|
|
}
|
|
|
|
@ -174,7 +174,7 @@ CargoPacket *CargoPacket::Split(uint new_size)
|
|
|
|
|
if (!CargoPacket::CanAllocateItem()) return nullptr;
|
|
|
|
|
|
|
|
|
|
Money fs = this->GetFeederShare(new_size);
|
|
|
|
|
CargoPacket *cp_new = new CargoPacket(new_size, this->periods_in_transit, this->first_station, this->next_station, this->source_xy, fs, this->source_type, this->source_id);
|
|
|
|
|
CargoPacket *cp_new = new CargoPacket(new_size, this->periods_in_transit, this->first_station, this->next_hop, this->source_xy, fs, this->source_type, this->source_id);
|
|
|
|
|
this->feeder_share -= fs;
|
|
|
|
|
|
|
|
|
|
if (this->flags & CPF_HAS_DEFERRED_PAYMENT) {
|
|
|
|
@ -690,7 +690,7 @@ bool VehicleCargoList::Stage(bool accepted, StationID current_station, StationID
|
|
|
|
|
share = payment->PayTransfer(cp, cp->count);
|
|
|
|
|
cp->AddFeederShare(share);
|
|
|
|
|
this->feeder_share += share;
|
|
|
|
|
cp->next_station = cargo_next;
|
|
|
|
|
cp->next_hop = cargo_next;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
NOT_REACHED();
|
|
|
|
@ -760,7 +760,7 @@ uint VehicleCargoList::Reassign<VehicleCargoList::MTA_DELIVER, VehicleCargoList:
|
|
|
|
|
*/
|
|
|
|
|
++it;
|
|
|
|
|
}
|
|
|
|
|
cp->next_station = INVALID_STATION;
|
|
|
|
|
cp->next_hop = INVALID_STATION;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this->action_counts[MTA_DELIVER] -= max_move;
|
|
|
|
|