1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-19 02:12:37 +01:00

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 20:00:57 +01:00
committed by GitHub
parent 851310108f
commit dd2cf93164

View File

@@ -1881,7 +1881,11 @@ uint16_t GetServiceIntervalClamped(int interval, bool ispercent)
*/
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);
});
}
/**