Fix incorrect check preventing ordering road vehicles to incompatible depots

This commit is contained in:
Jonathan G Rennison
2022-03-29 22:24:34 +01:00
parent d3efa2afe0
commit 5f511f8a65
3 changed files with 5 additions and 5 deletions

View File

@@ -2460,7 +2460,7 @@ public:
if (IsDepotTile(tile) && GetDepotVehicleType(tile) == this->vli.vtype) {
if (this->vli.type != VL_DEPOT_LIST) return;
if (!IsInfraTileUsageAllowed(this->vli.vtype, this->vli.company, tile)) return;
if (this->vli.vtype == VEH_ROAD && GetRoadTypes(Depot::Get(this->vli.index)->xy) != GetRoadTypes(tile)) return;
if (this->vli.vtype == VEH_ROAD && GetPresentRoadTypes(Depot::Get(this->vli.index)->xy) != GetRoadTypes(tile)) return;
DestinationID dest = (this->vli.vtype == VEH_AIRCRAFT) ? GetStationIndex(tile) : GetDepotIndex(tile);
DoCommandP(0, this->vli.index | (this->vli.vtype << 16) | (OT_GOTO_DEPOT << 20), dest, CMD_MASS_CHANGE_ORDER);