From 1364f524054c908cc9bd56cf3f703a8be348ae12 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Sat, 26 Nov 2022 18:43:16 +0000 Subject: [PATCH] Fix go to nearest depot orders using the location of a particular depot --- src/order_cmd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/order_cmd.cpp b/src/order_cmd.cpp index 08493f4534..bbead403ec 100644 --- a/src/order_cmd.cpp +++ b/src/order_cmd.cpp @@ -917,6 +917,7 @@ TileIndex Order::GetLocation(const Vehicle *v, bool airport) const return BaseStation::Get(this->GetDestination())->xy; case OT_GOTO_DEPOT: + if (this->GetDepotActionType() & ODATFB_NEAREST_DEPOT) return INVALID_TILE; if (this->GetDestination() == INVALID_DEPOT) return INVALID_TILE; return (v->type == VEH_AIRCRAFT) ? Station::Get(this->GetDestination())->xy : Depot::Get(this->GetDestination())->xy;