-
-
Notifications
You must be signed in to change notification settings - Fork 968
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
Feature: Close adjacent level crossings as if they were one large crossing #8444
Conversation
Your missing |
I vaguely remember that there was a second source of that sound, when a train was approaching a crossing tile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda stopped my review half-way through. Please spend some more time on code quality here. So many things that appear to be in a half-state, that it made me check if this was a draft PR (it was not).
it probably should be. |
i revisited the crossing sound effect. before this PR, crossing sound was played in two different ways a) when a crossing without a PBS nearby gets closed case a) was a bit awkward in my patch, since that might result in multiple crossing sounds being played at once, so i opted instead to drop case a) and change case b) to be in all cases i opted to do this in a separate commit, in case it was somehow controversial |
…nstead of sometimes on closing
Motivation / Problem
Level crossings on parallel tracks can be dangerous, especially for articulated road vehicles, or if multiple road vehicles follow each other. Often, a vehicle is waiting for a level crossing to open, when it suddenly gets struck in its "tail" by another train.
Description
Updated patch from https://www.tt-forums.net/viewtopic.php?f=33&t=46091
This patch tries to avoid the situation that a vehicle gets stuck inbetween two tracks by closing all level crossings simultaneously, and instead allowing road vehicles to leave a crossing they already entered. Best combined with a path signal some tiles ahead of a level crossing, to give vehicles time to leave if a train approaches.
Limitations
on loading an old savegame, road vehicles that were previously waiting for a crossing to open, may now immediately start up, causing them to run straight into a train. some savegame conversion update is needed.
also, a call toSndPlayTileFx(SND_0E_LEVEL_CROSSING, tile);
fell off and i don't remember where it went, or why i removed it.Update: level crossing sound is now changed to only appear when a train approaches the crossing, instead of sometimes when it is being closed.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.