Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: Allow locks under bridges #7200

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -423,7 +423,7 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u

switch (GetTileType(tile)) {
case MP_WATER:
if (!IsWater(tile) && !IsCoast(tile)) goto not_valid_below;
if (!IsWater(tile) && !IsCoast(tile) && !IsLock(tile)) goto not_valid_below;

This comment has been minimized.

Copy link
@SamuXarick

SamuXarick Feb 20, 2019

Contributor
Suggested change
if (!IsWater(tile) && !IsCoast(tile) && !IsLock(tile)) goto not_valid_below;
if (!IsWater(tile) && !IsCoast(tile) && !IsLock(tile)) goto not_valid_below;
if (IsLock(tile) && GetLockPart(tile) == LOCK_PART_LOWER && GetTileMaxZ(tile) + 1 > z_start) return_cmd_error(STR_ERROR_BRIDGE_TOO_LOW_FOR_TERRAIN);
break;

case MP_RAILWAY:
@@ -286,10 +286,6 @@ static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlag
}
WaterClass wc_upper = IsWaterTile(tile + delta) ? GetWaterClass(tile + delta) : WATER_CLASS_CANAL;

if (IsBridgeAbove(tile) || IsBridgeAbove(tile - delta) || IsBridgeAbove(tile + delta)) {

This comment has been minimized.

Copy link
@SamuXarick

SamuXarick Feb 20, 2019

Contributor
if (IsBridgeAbove(tile - delta)) {
	int z_lower_bridge = GetBridgeHeight(GetNorthernBridgeEnd(tile - delta));
	if (z_lower_bridge <= GetTileMaxZ(tile - delta) + 1) return_cmd_error(STR_ERROR_BRIDGE_TOO_LOW_FOR_TERRAIN);
}
return_cmd_error(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST);
}

if (flags & DC_EXEC) {
/* Update company infrastructure counts. */
Company *c = Company::GetIfValid(_current_company);
@@ -857,6 +853,7 @@ static void DrawTile_Water(TileInfo *ti)

case WATER_TILE_LOCK:
DrawWaterLock(ti);
DrawBridgeMiddle(ti);
break;

case WATER_TILE_DEPOT:
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.