Fix #14610: Do not treat aircraft with only depot orders as having valid orders (#14961)

This commit is contained in:
Nusio_coding
2025-12-27 14:00:57 -05:00
committed by GitHub
parent 851310108f
commit dd2cf93164
+5 -1
View File
@@ -1881,7 +1881,11 @@ uint16_t GetServiceIntervalClamped(int interval, bool ispercent)
*/ */
static bool CheckForValidOrders(const Vehicle *v) static bool CheckForValidOrders(const Vehicle *v)
{ {
return std::ranges::any_of(v->Orders(), [](const Order &order) { return order.IsGotoOrder(); }); /* Check if vehicle has any valid orders.
* Function is only called for aircraft, no type check needed. */
return std::ranges::any_of(v->Orders(), [](const Order &order) {
return order.IsGotoOrder() && !order.IsType(OT_GOTO_DEPOT);
});
} }
/** /**