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

Feature: Setting to disallow level crossings with competitors #10755

Merged
merged 1 commit into from
Sep 2, 2023

Conversation

mrmbernardi
Copy link
Contributor

@mrmbernardi mrmbernardi commented May 1, 2023

Motivation / Problem

See #10311

Players can construct level crossings with other player's roads/rails and cause collisions.

Description

I added a setting which prevents players from constructing level crossings on other player's (or AI's) roads/rails.

It doesn't affect infrastructure constructed by towns or scripts.

Closes #10311 (edit 2TT)

Limitations

Perhaps we should think more about the implications of preventing towns from constructing level crossings.

On one hand, collisions can still occur. On the other, it would be a bit cheesy to block towns from growing with just one rail.
Also, it's harder to grief with the roads towns build.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

Copy link
Member

@2TallTyler 2TallTyler left a comment

Choose a reason for hiding this comment

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

Please use the PR template, it's there for a reason to help us review your proposal more easily. 🙂

Also, we typically only use an issue number in the commit when fixing something. A better title for this might be Feature: Setting to disallow level crossings with competitors.

src/saveload/saveload.h Outdated Show resolved Hide resolved
@2TallTyler 2TallTyler added preview This PR is receiving preview builds candidate: needs considering This Pull Request needs more opinions labels May 1, 2023
@DorpsGek DorpsGek temporarily deployed to preview-pr-10755 May 1, 2023 21:43 Inactive
@DorpsGek DorpsGek temporarily deployed to preview-pr-10755 May 1, 2023 21:44 Inactive
@DorpsGek DorpsGek temporarily deployed to preview-pr-10755 May 1, 2023 21:56 Inactive
@DorpsGek DorpsGek temporarily deployed to preview-pr-10755 May 1, 2023 21:57 Inactive
@mrmbernardi mrmbernardi changed the title Add #10311: Added a setting to prevent level crossings with competitors. Feature: Setting to disallow level crossings with competitors May 1, 2023
@DorpsGek DorpsGek temporarily deployed to preview-pr-10755 May 1, 2023 22:02 Inactive
@DorpsGek DorpsGek temporarily deployed to preview-pr-10755 May 8, 2023 08:42 Inactive
Copy link
Member

@2TallTyler 2TallTyler left a comment

Choose a reason for hiding this comment

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

Otherwise looks good to me.

src/rail_cmd.cpp Outdated Show resolved Hide resolved
@DorpsGek DorpsGek temporarily deployed to preview-pr-10755 June 14, 2023 12:30 Inactive
@DorpsGek DorpsGek temporarily deployed to preview-pr-10755 June 14, 2023 12:31 Inactive
2TallTyler
2TallTyler previously approved these changes Jun 14, 2023
Copy link
Member

@2TallTyler 2TallTyler left a comment

Choose a reason for hiding this comment

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

Technology cannot fully prevent griefing, but we can make it less fun.

It's another setting, but it does rhyme with the "allow building road stops" setting so there's precedent for this sort of thing.

Other developers are more than welcome to disagree with me. I won't use this myself, but see no good reason not to add it. 😄

@bjornwarmedal
Copy link
Contributor

I agree with 2TallTyler. It's not a setting I would necessarily use as a social contract generally handles this kind of griefing, but I definitely see where it would be useful.

@TrueBrain TrueBrain added preview This PR is receiving preview builds and removed preview This PR is receiving preview builds labels Jul 8, 2023
@TrueBrain TrueBrain temporarily deployed to preview July 8, 2023 12:14 — with GitHub Actions Inactive
@mrmbernardi mrmbernardi temporarily deployed to preview July 27, 2023 18:27 — with GitHub Actions Inactive
2TallTyler
2TallTyler previously approved these changes Jul 27, 2023
@mrmbernardi
Copy link
Contributor Author

mrmbernardi commented Jul 27, 2023

I've rebased the branch. One point in favour I'd like to highlight is that this setting is sort of symmetrical to the existing "Allow drive-through road stops on roads owned by competitors" setting.

@2TallTyler
Copy link
Member

Sorry, I created a conflict. 😢 I'll re-approve once you rebase.

@michicc michicc merged commit a5c8365 into OpenTTD:master Sep 2, 2023
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
candidate: needs considering This Pull Request needs more opinions preview This PR is receiving preview builds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request]: Add a setting to prevent crossing tracks with other players roads
6 participants