Fix send vehicle to specific depot allowing incompatible road/tram types
See: #302
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user