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.

(cherry picked from commit df400ef84a)
This commit is contained in:
Patric Stout
2023-09-19 22:16:31 +02:00
committed by Jonathan G Rennison
parent 05c35c8e31
commit 4280c413a6
11 changed files with 144 additions and 21 deletions

View File

@@ -71,9 +71,11 @@ public:
/** Action of transferring cargo from a vehicle to a station. */
class CargoTransfer : public CargoMovement<VehicleCargoList, StationCargoList> {
protected:
TileIndex current_tile; ///< Current tile cargo unloading is happening.
public:
CargoTransfer(VehicleCargoList *source, StationCargoList *destination, uint max_move) :
CargoMovement<VehicleCargoList, StationCargoList>(source, destination, max_move) {}
CargoTransfer(VehicleCargoList *source, StationCargoList *destination, uint max_move, TileIndex current_tile) :
CargoMovement<VehicleCargoList, StationCargoList>(source, destination, max_move), current_tile(current_tile) {}
bool operator()(CargoPacket *cp);
};
@@ -97,10 +99,12 @@ public:
/** Action of returning previously reserved cargo from the vehicle to the station. */
class CargoReturn : public CargoMovement<VehicleCargoList, StationCargoList> {
protected:
TileIndex current_tile; ///< Current tile cargo unloading is happening.
StationID next;
public:
CargoReturn(VehicleCargoList *source, StationCargoList *destination, uint max_move, StationID next) :
CargoMovement<VehicleCargoList, StationCargoList>(source, destination, max_move), next(next) {}
CargoReturn(VehicleCargoList *source, StationCargoList *destination, uint max_move, StationID next, TileIndex current_tile) :
CargoMovement<VehicleCargoList, StationCargoList>(source, destination, max_move), current_tile(current_tile), next(next) {}
bool operator()(CargoPacket *cp);
};