(svn r9996) -Fix: be more strict when building/upgrading roads and/or road stops.

This commit is contained in:
rubidium
2007-05-31 07:34:40 +00:00
parent 9cb7ebfccc
commit a4750af656
2 changed files with 7 additions and 0 deletions

View File

@@ -427,12 +427,16 @@ int32 CmdBuildRoad(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
case MP_STATION:
if (!IsDriveThroughStopTile(tile)) return CMD_ERROR;
if (HASBIT(GetRoadTypes(tile), rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
/* Don't allow "upgrading" the roadstop when vehicles are already driving on it */
if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
break;
case MP_TUNNELBRIDGE:
if ((IsTunnel(tile) && GetTunnelTransportType(tile) != TRANSPORT_ROAD) ||
(IsBridge(tile) && GetBridgeTransportType(tile) != TRANSPORT_ROAD)) return CMD_ERROR;
if (HASBIT(GetRoadTypes(tile), rt)) return_cmd_error(STR_1007_ALREADY_BUILT);
/* Don't allow "upgrading" the bridge/tunnel when vehicles are already driving on it */
if (!EnsureNoVehicleOnGround(tile)) return CMD_ERROR;
break;
default: