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

Conversation

PeterN
Copy link
Member

@PeterN PeterN commented Feb 9, 2019

WIP due to sprite ordering issues.

@PeterN PeterN added the wip Work in progress. Feature branch that will require feedback during the development process label Feb 9, 2019
@@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

@@ -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)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
}

@stale
Copy link

stale bot commented Mar 22, 2019

This pull request has been automatically marked as stale because it has not had any activity in the last month.
Please feel free to give a status update now, ping for review, or re-open when it's ready.
It will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@stale stale bot added the stale Stale issues label Mar 22, 2019
@stale stale bot closed this Mar 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale issues wip Work in progress. Feature branch that will require feedback during the development process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants