diff options
author | zuu <zuu@openttd.org> | 2013-10-13 20:11:05 +0000 |
---|---|---|
committer | zuu <zuu@openttd.org> | 2013-10-13 20:11:05 +0000 |
commit | cef1c47f18591678fbe4df4e0f343b6561cb6b01 (patch) | |
tree | 7370f95304dec517a7937ffcc0d75770d7ba2658 /src/vehicle_cmd.cpp | |
parent | 12ddbb7cb11ddeba47a6bed8d36bef6432aa3236 (diff) | |
download | openttd-cef1c47f18591678fbe4df4e0f343b6561cb6b01.tar.xz |
(svn r25865) -Codechange: Refactor detecting of depot vehicle type of a tile to a new function, GetDepotVehicleType (cirdan, LordAro)
Diffstat (limited to 'src/vehicle_cmd.cpp')
-rw-r--r-- | src/vehicle_cmd.cpp | 9 |
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); |