summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-05-26 20:30:55 +0000
committerbjarni <bjarni@openttd.org>2007-05-26 20:30:55 +0000
commitae9b3c41e024d3e668db90e4acda681986405a46 (patch)
tree1051ba232cada2a772c69fbbd6669fe238880712 /src
parenta88d005c766e6847abe6712cab3b2bd0449c6296 (diff)
downloadopenttd-ae9b3c41e024d3e668db90e4acda681986405a46.tar.xz
(svn r9941) -Fix: trams could be cloned to appear in normal road depots and vice versa (spotted by Desolator)
Diffstat (limited to 'src')
-rw-r--r--src/lang/english.txt1
-rw-r--r--src/roadveh_cmd.cpp2
2 files changed, 3 insertions, 0 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 96e3e14c5..f47c3328b 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -3030,6 +3030,7 @@ STR_VEH_WITH_SHARED_ORDERS_LIST_TIP :{BLACK}Show all
### depot strings
STR_DEPOT_SELL_CONFIRMATION_TEXT :{YELLOW}You are about to sell all the vehicles in the depot. Are you sure?
+STR_DEPOT_WRONG_DEPOT_TYPE :Wrong depot type
STR_DEPOT_SELL_ALL_BUTTON_TRAIN_TIP :{BLACK}Sell all trains in the depot
STR_DEPOT_SELL_ALL_BUTTON_ROADVEH_TIP :{BLACK}Sell all road vehicles in the depot
diff --git a/src/roadveh_cmd.cpp b/src/roadveh_cmd.cpp
index 00cba917e..d411e92a7 100644
--- a/src/roadveh_cmd.cpp
+++ b/src/roadveh_cmd.cpp
@@ -145,6 +145,8 @@ int32 CmdBuildRoadVeh(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (!IsTileDepotType(tile, TRANSPORT_ROAD)) return CMD_ERROR;
if (!IsTileOwner(tile, _current_player)) return CMD_ERROR;
+ if (HASBIT(GetRoadTypes(tile), ROADTYPE_TRAM) != HASBIT(EngInfo(p1)->misc_flags, EF_ROAD_TRAM)) return_cmd_error(STR_DEPOT_WRONG_DEPOT_TYPE);
+
v = AllocateVehicle();
if (v == NULL) return_cmd_error(STR_00E1_TOO_MANY_VEHICLES_IN_GAME);