summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-05-30 20:13:58 +0000
committerrubidium <rubidium@openttd.org>2007-05-30 20:13:58 +0000
commit1e371a99d2b24b5c040bc159e42bbfd41e3139ef (patch)
treeb23708e1f380d7ac0e333740a3f59ae45b236bf4 /src
parentb5915a25df1fcbcb92c0591f520d673b29b1b6e8 (diff)
downloadopenttd-1e371a99d2b24b5c040bc159e42bbfd41e3139ef.tar.xz
(svn r9991) -Fix: one could build road when trams were driving on the tile and vice versa.
Diffstat (limited to 'src')
-rw-r--r--src/road_cmd.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp
index b0bd6ec6f..7586a9f49 100644
--- a/src/road_cmd.cpp
+++ b/src/road_cmd.cpp
@@ -361,6 +361,8 @@ int32 CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
switch (GetRoadTileType(tile)) {
case ROAD_TILE_NORMAL:
if (HasRoadWorks(tile)) return_cmd_error(STR_ROAD_WORKS_IN_PROGRESS);
+ if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
+
all_bits = GetAllRoadBits(tile);
if (!HASBIT(GetRoadTypes(tile), rt)) break;
@@ -368,7 +370,6 @@ int32 CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if ((existing & pieces) == pieces) {
return_cmd_error(STR_1007_ALREADY_BUILT);
}
- if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
break;
case ROAD_TILE_CROSSING: