mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-29 17:39:09 +00:00
(svn r9991) -Fix: one could build road when trams were driving on the tile and vice versa.
This commit is contained in:
@@ -361,6 +361,8 @@ int32 CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||||||
switch (GetRoadTileType(tile)) {
|
switch (GetRoadTileType(tile)) {
|
||||||
case ROAD_TILE_NORMAL:
|
case ROAD_TILE_NORMAL:
|
||||||
if (HasRoadWorks(tile)) return_cmd_error(STR_ROAD_WORKS_IN_PROGRESS);
|
if (HasRoadWorks(tile)) return_cmd_error(STR_ROAD_WORKS_IN_PROGRESS);
|
||||||
|
if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
|
||||||
|
|
||||||
all_bits = GetAllRoadBits(tile);
|
all_bits = GetAllRoadBits(tile);
|
||||||
if (!HASBIT(GetRoadTypes(tile), rt)) break;
|
if (!HASBIT(GetRoadTypes(tile), rt)) break;
|
||||||
|
|
||||||
@@ -368,7 +370,6 @@ int32 CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
|||||||
if ((existing & pieces) == pieces) {
|
if ((existing & pieces) == pieces) {
|
||||||
return_cmd_error(STR_1007_ALREADY_BUILT);
|
return_cmd_error(STR_1007_ALREADY_BUILT);
|
||||||
}
|
}
|
||||||
if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ROAD_TILE_CROSSING:
|
case ROAD_TILE_CROSSING:
|
||||||
|
Reference in New Issue
Block a user