Merge branch 'cargo_type_order' into jgrpp

# Conflicts:
#	src/order_base.h
#	src/order_gui.cpp
#	src/order_type.h
#	src/saveload/extended_ver_sl.cpp
#	src/saveload/extended_ver_sl.h
#	src/vehicle_base.h
This commit is contained in:
Jonathan G Rennison
2016-09-08 00:12:48 +01:00
19 changed files with 1079 additions and 159 deletions

View File

@@ -58,6 +58,7 @@ enum VehicleFlags {
// Additional flags not in trunk are added at the end to avoid clashing with any new
// flags which get added in future trunk, and to avoid re-ordering flags which are in trunk already,
// as this breaks savegame compatibility.
VF_LAST_LOAD_ST_SEP = 13, ///< Each vehicle of this chain has its last_loading_station field set separately
VF_TIMETABLE_SEPARATION = 14,///< Whether the vehicle should manage the timetable automatically.
VF_AUTOMATE_TIMETABLE = 15, ///< Whether the vehicle should manage the timetable automatically.
};
@@ -252,7 +253,7 @@ public:
byte waiting_triggers; ///< Triggers to be yet matched before rerandomizing the random bits.
StationID last_station_visited; ///< The last station we stopped at.
StationID last_loading_station; ///< Last station the vehicle has stopped at and could possibly leave from with any cargo loaded.
StationID last_loading_station; ///< Last station the vehicle has stopped at and could possibly leave from with any cargo loaded. (See VF_LAST_LOAD_ST_SEP).
CargoID cargo_type; ///< type of cargo this vehicle is carrying
byte cargo_subtype; ///< Used for livery refits (NewGRF variations)
@@ -290,6 +291,8 @@ public:
/** We want to 'destruct' the right class. */
virtual ~Vehicle();
uint32 GetLastLoadingStationValidCargoMask() const;
void BeginLoading();
void CancelReservation(StationID next, Station *st);
void LeaveStation();
@@ -688,9 +691,11 @@ public:
* Get the next station the vehicle will stop at.
* @return ID of the next station the vehicle will stop at or INVALID_STATION.
*/
inline StationIDStack GetNextStoppingStation() const
inline CargoStationIDStackSet GetNextStoppingStation() const
{
return (this->orders.list == NULL) ? INVALID_STATION : this->orders.list->GetNextStoppingStation(this);
CargoStationIDStackSet set;
if (this->orders.list != NULL) set.FillNextStoppingStation(this, this->orders.list);
return set;
}
void RecalculateOrderOccupancyAverage();