From ab52f7eecfa27ab5e612d5cd30d515bb7ca601a7 Mon Sep 17 00:00:00 2001 From: SamuXarick <43006711+SamuXarick@users.noreply.github.com> Date: Mon, 19 Feb 2024 22:21:06 +0000 Subject: [PATCH] Fix ccb4c37: Aircraft could route to hangars outside their range when stopping at them --- src/aircraft_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 7ad284b5b7..78260edb9b 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -134,7 +134,7 @@ static StationID FindNearestHangar(const Aircraft *v) const Station *next_dest = nullptr; if (max_range != 0) { if (v->current_order.IsType(OT_GOTO_STATION) || - (v->current_order.IsType(OT_GOTO_DEPOT) && v->current_order.GetDepotActionType() != ODATFB_NEAREST_DEPOT)) { + (v->current_order.IsType(OT_GOTO_DEPOT) && (v->current_order.GetDepotActionType() & ODATFB_NEAREST_DEPOT) == 0)) { last_dest = Station::GetIfValid(v->last_station_visited); next_dest = Station::GetIfValid(v->current_order.GetDestination()); } else {