diff options
Diffstat (limited to 'src/vehicle_base.h')
-rw-r--r-- | src/vehicle_base.h | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 350b5e7c5..8883470ab 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -470,6 +470,25 @@ public: if (this->cur_order_index >= this->GetNumOrders()) this->cur_order_index = 0; InvalidateVehicleOrder(this, 0); } + + /** + * Returns order 'index' of a vehicle or NULL when it doesn't exists + * @param index the order to fetch + * @return the found (or not) order + */ + inline Order *GetOrder(int index) const + { + return (this->orders.list == NULL) ? NULL : this->orders.list->GetOrderAt(index); + } + + /** + * Returns the last order of a vehicle, or NULL if it doesn't exists + * @return last order of a vehicle, if available + */ + inline Order *GetLastOrder() const + { + return (this->orders.list == NULL) ? NULL : this->orders.list->GetLastOrder(); + } }; /** @@ -520,16 +539,6 @@ struct FreeUnitIDGenerator { ~FreeUnitIDGenerator() { free(this->cache); } }; -/* Returns order 'index' of a vehicle or NULL when it doesn't exists */ -static inline Order *GetVehicleOrder(const Vehicle *v, int index) { return (v->orders.list == NULL) ? NULL : v->orders.list->GetOrderAt(index); } - -/** - * Returns the last order of a vehicle, or NULL if it doesn't exists - * @param v Vehicle to query - * @return last order of a vehicle, if available - */ -static inline Order *GetLastVehicleOrder(const Vehicle *v) { return (v->orders.list == NULL) ? NULL : v->orders.list->GetLastOrder(); } - void CheckVehicle32Day(Vehicle *v); static const int32 INVALID_COORD = 0x7fffffff; |