summaryrefslogtreecommitdiff
path: root/src/vehicle_cmd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vehicle_cmd.cpp')
-rw-r--r--src/vehicle_cmd.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp
index 68e6fff1a..f45bd4b5a 100644
--- a/src/vehicle_cmd.cpp
+++ b/src/vehicle_cmd.cpp
@@ -85,14 +85,7 @@ CommandCost CmdBuildVehicle(TileIndex tile, DoCommandFlag flags, uint32 p1, uint
/* Elementary check for valid location. */
if (!IsDepotTile(tile) || !IsTileOwner(tile, _current_company)) return CMD_ERROR;
- VehicleType type;
- switch (GetTileType(tile)) {
- case MP_RAILWAY: type = VEH_TRAIN; break;
- case MP_ROAD: type = VEH_ROAD; break;
- case MP_WATER: type = VEH_SHIP; break;
- case MP_STATION: type = VEH_AIRCRAFT; break;
- default: NOT_REACHED(); // Safe due to IsDepotTile()
- }
+ VehicleType type = GetDepotVehicleType(tile);
/* Validate the engine type. */
EngineID eid = GB(p1, 0, 16);