Fix: only count distance traveled in vehicles for cargo payment (#11283)
No longer you can utilize the free (and instant) labour of station workers, transporting your cargo from one part of the station to the other. No more! Based on patch by dP.
This commit is contained in:
@@ -79,8 +79,12 @@ CargoPacket::CargoPacket(uint16_t count, Money feeder_share, CargoPacket &origin
|
||||
periods_in_transit(original.periods_in_transit),
|
||||
feeder_share(feeder_share),
|
||||
source_xy(original.source_xy),
|
||||
travelled(original.travelled),
|
||||
source_id(original.source_id),
|
||||
source_type(original.source_type),
|
||||
#ifdef WITH_ASSERT
|
||||
in_vehicle(original.in_vehicle),
|
||||
#endif /* WITH_ASSERT */
|
||||
first_station(original.first_station),
|
||||
next_hop(original.next_hop)
|
||||
{
|
||||
@@ -587,12 +591,13 @@ uint VehicleCargoList::Reassign<VehicleCargoList::MTA_DELIVER, VehicleCargoList:
|
||||
* @param max_move Maximum amount of cargo to move.
|
||||
* @param dest Station the cargo is returned to.
|
||||
* @param next ID of the next station the cargo wants to go to.
|
||||
* @param current_tile Current tile the cargo handling is happening on.
|
||||
* @return Amount of cargo actually returned.
|
||||
*/
|
||||
uint VehicleCargoList::Return(uint max_move, StationCargoList *dest, StationID next)
|
||||
uint VehicleCargoList::Return(uint max_move, StationCargoList *dest, StationID next, TileIndex current_tile)
|
||||
{
|
||||
max_move = std::min(this->action_counts[MTA_LOAD], max_move);
|
||||
this->PopCargo(CargoReturn(this, dest, max_move, next));
|
||||
this->PopCargo(CargoReturn(this, dest, max_move, next, current_tile));
|
||||
return max_move;
|
||||
}
|
||||
|
||||
@@ -623,7 +628,7 @@ uint VehicleCargoList::Unload(uint max_move, StationCargoList *dest, CargoPaymen
|
||||
uint moved = 0;
|
||||
if (this->action_counts[MTA_TRANSFER] > 0) {
|
||||
uint move = std::min(this->action_counts[MTA_TRANSFER], max_move);
|
||||
this->ShiftCargo(CargoTransfer(this, dest, move));
|
||||
this->ShiftCargo(CargoTransfer(this, dest, move, current_tile));
|
||||
moved += move;
|
||||
}
|
||||
if (this->action_counts[MTA_TRANSFER] == 0 && this->action_counts[MTA_DELIVER] > 0 && moved < max_move) {
|
||||
|
Reference in New Issue
Block a user