Merge branch 'master' into jgrpp

# Conflicts:
#	src/economy.cpp
#	src/linkgraph/refresh.cpp
#	src/order_cmd.cpp
#	src/saveload/vehicle_sl.cpp
#	src/station.cpp
#	src/station_base.h
#	src/timetable_cmd.cpp
#	src/timetable_gui.cpp
#	src/vehicle.cpp
#	src/vehicle_base.h
#	src/vehicle_cmd.cpp
This commit is contained in:
Jonathan G Rennison
2022-03-04 18:17:44 +00:00
37 changed files with 296 additions and 245 deletions

View File

@@ -368,9 +368,9 @@ public:
Order current_order; ///< The current order (+ status, like: loading)
union {
OrderList *list; ///< Pointer to the order list for this vehicle
Order *old; ///< Only used during conversion of old save games
} orders; ///< The orders currently assigned to the vehicle.
OrderList *orders; ///< Pointer to the order list for this vehicle
Order *old_orders; ///< Only used during conversion of old save games
};
uint16 load_unload_ticks; ///< Ticks to wait before starting next cycle.
GroupID group_id; ///< Index of group Pool array
@@ -746,7 +746,7 @@ public:
* Get the first order of the vehicles order list.
* @return first order of order list.
*/
inline Order *GetFirstOrder() const { return (this->orders.list == nullptr) ? nullptr : this->orders.list->GetFirstOrder(); }
inline Order *GetFirstOrder() const { return (this->orders == nullptr) ? nullptr : this->orders->GetFirstOrder(); }
/**
* Clears this vehicle's separation status
@@ -772,25 +772,25 @@ public:
* Get the first vehicle of this vehicle chain.
* @return the first vehicle of the chain.
*/
inline Vehicle *FirstShared() const { return (this->orders.list == nullptr) ? this->First() : this->orders.list->GetFirstSharedVehicle(); }
inline Vehicle *FirstShared() const { return (this->orders == nullptr) ? this->First() : this->orders->GetFirstSharedVehicle(); }
/**
* Check if we share our orders with another vehicle.
* @return true if there are other vehicles sharing the same order
*/
inline bool IsOrderListShared() const { return this->orders.list != nullptr && this->orders.list->IsShared(); }
inline bool IsOrderListShared() const { return this->orders != nullptr && this->orders->IsShared(); }
/**
* Get the number of orders this vehicle has.
* @return the number of orders this vehicle has.
*/
inline VehicleOrderID GetNumOrders() const { return (this->orders.list == nullptr) ? 0 : this->orders.list->GetNumOrders(); }
inline VehicleOrderID GetNumOrders() const { return (this->orders == nullptr) ? 0 : this->orders->GetNumOrders(); }
/**
* Get the number of manually added orders this vehicle has.
* @return the number of manually added orders this vehicle has.
*/
inline VehicleOrderID GetNumManualOrders() const { return (this->orders.list == nullptr) ? 0 : this->orders.list->GetNumManualOrders(); }
inline VehicleOrderID GetNumManualOrders() const { return (this->orders == nullptr) ? 0 : this->orders->GetNumManualOrders(); }
/**
* Get the next station the vehicle will stop at.
@@ -799,7 +799,7 @@ public:
inline CargoStationIDStackSet GetNextStoppingStation() const
{
CargoStationIDStackSet set;
if (this->orders.list != nullptr) set.FillNextStoppingStation(this, this->orders.list);
if (this->orders != nullptr) set.FillNextStoppingStation(this, this->orders);
return set;
}
@@ -810,7 +810,7 @@ public:
inline StationIDStack GetNextStoppingStationCargoIndependent() const
{
StationIDStack set;
if (this->orders.list != nullptr) set = this->orders.list->GetNextStoppingStation(this, 0).station;
if (this->orders != nullptr) set = this->orders->GetNextStoppingStation(this, 0).station;
return set;
}
@@ -1003,7 +1003,7 @@ public:
*/
inline Order *GetOrder(int index) const
{
return (this->orders.list == nullptr) ? nullptr : this->orders.list->GetOrderAt(index);
return (this->orders == nullptr) ? nullptr : this->orders->GetOrderAt(index);
}
/**
@@ -1013,7 +1013,7 @@ public:
*/
inline VehicleOrderID GetIndexOfOrder(const Order *order) const
{
return (this->orders.list == nullptr) ? INVALID_VEH_ORDER_ID : this->orders.list->GetIndexOfOrder(order);
return (this->orders == nullptr) ? INVALID_VEH_ORDER_ID : this->orders->GetIndexOfOrder(order);
}
/**
@@ -1022,7 +1022,7 @@ public:
*/
inline Order *GetLastOrder() const
{
return (this->orders.list == nullptr) ? nullptr : this->orders.list->GetLastOrder();
return (this->orders == nullptr) ? nullptr : this->orders->GetLastOrder();
}
bool IsEngineCountable() const;
@@ -1199,7 +1199,7 @@ public:
* Returns an iterable ensemble of orders of a vehicle
* @return an iterable ensemble of orders of a vehicle
*/
IterateWrapper Orders() const { return IterateWrapper(this->orders.list); }
IterateWrapper Orders() const { return IterateWrapper(this->orders); }
};
inline bool IsPointInViewportVehicleRedrawArea(const std::vector<Rect> &viewport_redraw_rects, const Point &pt)