Skip to content

Fix: Make sea level locks aware of neighbouring canals#238

Open
zephyris wants to merge 1 commit intomainfrom
fix-237-sea-level-lock
Open

Fix: Make sea level locks aware of neighbouring canals#238
zephyris wants to merge 1 commit intomainfrom
fix-237-sea-level-lock

Conversation

@zephyris
Copy link
Contributor

Canal locks checked for elevation, to use alternate graphics with mini-lighthouses and breaking waves when at sea level. This looked odd when building locks on sea level land.

Therefore, add a canal_dike check, to check if canal walls would be built for that tile as a half-decent proxy for checking for neighbouring land tiles. Compare the top two locks in the example image.
image

(mostly) Fixes #237

Corner cases are when the lock is surrounded by sea level locks or rivers. Com[are the bottom two locks in the example image.

@zephyris zephyris force-pushed the fix-237-sea-level-lock branch 2 times, most recently from b2c80f2 to 14a1561 Compare January 21, 2026 20:25
@zephyris zephyris force-pushed the fix-237-sea-level-lock branch from 14a1561 to 372dd61 Compare January 21, 2026 20:27
@LordAro
Copy link
Member

LordAro commented Feb 17, 2026

I guess it's probably an improvement overall, but to me that left-hand lock will be more common than would be desirable. Have you had a look at it in "real world" maps ?

@zephyris
Copy link
Contributor Author

Fair point. Though, lock next to canal in general doesn't look great. More of an issue of OpenTTD drawing the canal bank next to the lock?

image image image

@mmtunligit
Copy link

this seems to me like the proper solution would be making canals aware of locks, and not drawing that extension if there is one, i dunno if thats possible without code changes in the main repo though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lock is leaking when placed at sea level.

3 participants