Merge branch 'order_occupancy-sx' into jgrpp

This commit is contained in:
Jonathan G Rennison
2016-01-24 02:52:05 +00:00
5 changed files with 62 additions and 5 deletions

View File

@@ -278,6 +278,8 @@ public:
byte running_ticks; ///< Number of ticks this vehicle was not stopped this day
byte vehstatus; ///< Status
uint8 order_occupancy_average; ///< NOSAVE: order occupancy average. 0 = invalid, 1 = n/a, 16-116 = 0-100%
Order current_order; ///< The current order (+ status, like: loading)
union {
@@ -704,6 +706,14 @@ public:
return (this->orders.list == NULL) ? INVALID_STATION : this->orders.list->GetNextStoppingStation(this);
}
void RecalculateOrderOccupancyAverage();
inline uint8 GetOrderOccupancyAverage() const
{
if (order_occupancy_average == 0) const_cast<Vehicle *>(this)->RecalculateOrderOccupancyAverage();
return this->order_occupancy_average;
}
void ResetRefitCaps();
/**