Fix go to nearest depot orders using the location of a particular depot

pull/453/head
Jonathan G Rennison 2 years ago
parent cd6ab2c385
commit 1364f52405

@ -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;

Loading…
Cancel
Save