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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Railtype flags to allow/disallow 90 degree curves. #7352

Merged
merged 1 commit into from Mar 10, 2019

Conversation

@michicc
Copy link
Member

michicc commented Mar 9, 2019

Somebody apparently already declared it official; I guess I better PR it 馃槂

This PR allows optional NewGRF control over the state of 90 deg curves. Narrow gauge might always allow it while high-speed might never allow it, or something like that.

* @param def Default value to use if the rail type doesn't specify anything.
* @return True if 90 degree turns are allowed between the two rail types.
*/
static inline bool Rail90DegTurnDisallowed(RailType rt1, RailType rt2, bool def = _settings_game.pf.forbid_90_deg)

This comment has been minimized.

Copy link
@nielsmh

nielsmh Mar 9, 2019

Contributor

Function name says "disallowed", but doc comment says it returns true if the turn is allowed. Negative bool variables/functions are confusing in general, try to make it positive.

This comment has been minimized.

Copy link
@michicc

michicc Mar 9, 2019

Author Member

Well, comment is wrong, function is right.

@michicc michicc force-pushed the michicc:pr/railtype_90deg branch from 1a51582 to 34a92ae Mar 9, 2019
@nielsmh nielsmh dismissed their stale review Mar 10, 2019

Comment fixed

@PeterN
PeterN approved these changes Mar 10, 2019
@PeterN PeterN merged commit cc5f175 into OpenTTD:master Mar 10, 2019
8 checks passed
8 checks passed
OpenTTD CI Build #20190309.33 succeeded
Details
OpenTTD CI (Linux commit-checker) Linux commit-checker succeeded
Details
OpenTTD CI (Linux linux-amd64-clang-3.8) Linux linux-amd64-clang-3.8 succeeded
Details
OpenTTD CI (Linux linux-amd64-gcc-6) Linux linux-amd64-gcc-6 succeeded
Details
OpenTTD CI (Linux linux-i386-gcc-6) Linux linux-i386-gcc-6 succeeded
Details
OpenTTD CI (MacOS) MacOS succeeded
Details
OpenTTD CI (Windows Win32) Windows Win32 succeeded
Details
OpenTTD CI (Windows Win64) Windows Win64 succeeded
Details
@michicc michicc deleted the michicc:pr/railtype_90deg branch Mar 10, 2019
nielsmh added a commit to nielsmh/OpenTTD that referenced this pull request Mar 11, 2019
douiwby added a commit to douiwby/OpenTTD that referenced this pull request Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can鈥檛 perform that action at this time.