diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 67d9ac3681..bbcae1d468 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -3574,6 +3574,9 @@ CommandCost Vehicle::SendToDepot(DoCommandFlag flags, DepotCommand command, Tile IsInfraTileUsageAllowed(this->type, this->owner, specific_depot))) { return_cmd_error(no_depot[this->type]); } + if (this->type == VEH_ROAD && (GetPresentRoadTypes(tile) & RoadVehicle::From(this)->compatible_roadtypes) == 0) { + return_cmd_error(no_depot[this->type]); + } location = specific_depot; destination = (this->type == VEH_AIRCRAFT) ? GetStationIndex(specific_depot) : GetDepotIndex(specific_depot); reverse = false; diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 69e5ea5e99..d7ee94fb98 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -3863,7 +3863,7 @@ public: { const Vehicle *v = Vehicle::Get(this->window_number); if (IsDepotTile(tile) && GetDepotVehicleType(tile) == v->type && IsInfraTileUsageAllowed(v->type, v->owner, tile)) { - if (v->type == VEH_ROAD && (GetRoadTypes(tile) & RoadVehicle::From(v)->compatible_roadtypes) == 0) return; + if (v->type == VEH_ROAD && (GetPresentRoadTypes(tile) & RoadVehicle::From(v)->compatible_roadtypes) == 0) return; DoCommandP(v->tile, v->index | (this->depot_select_ctrl_pressed ? DEPOT_SERVICE : 0U) | DEPOT_SPECIFIC, tile, GetCmdSendToDepot(v)); ResetObjectToPlace(); this->RaiseButtons();