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

Fix: removing long roads doesn't prioritize refusal of local authority over other errors #9831

Merged
merged 1 commit into from Mar 11, 2022

Conversation

TrueBrain
Copy link
Member

Fixes #9820

Motivation / Problem

Some errors are more equal than others. Ownership errors already were. Now local authority errors are too. See #9820 for example.

Description

See patch. Can't explain it in more words.

Limitations

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

@@ -1113,8 +1113,14 @@ std::tuple<CommandCost, Money> CmdRemoveLongRoad(DoCommandFlag flags, TileIndex
cost.AddCost(ret);
had_success = true;
} else {
/* Ownership errors are more important. */
if (last_error.GetErrorMessage() != STR_ERROR_OWNED_BY) last_error = ret;
/* Some errors are more equal than others. */
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
/* Some errors are more equal than others. */
/* Some errors are more important than others. */

The word "important" describes it better than "equal".

Copy link
Member Author

Choose a reason for hiding this comment

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

No. Humor is important!

Copy link
Member Author

Choose a reason for hiding this comment

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

PS: I can be bought off with cookies (or beer) to give me another opinion. Just saying ;)

@TrueBrain TrueBrain merged commit 68ec2a7 into OpenTTD:master Mar 11, 2022
@TrueBrain TrueBrain deleted the local-authority-wins branch March 11, 2022 15:18
@TrueBrain TrueBrain added the backport requested This PR should be backport to current release (RC / stable) label Apr 2, 2022
TrueBrain added a commit to TrueBrain/OpenTTD that referenced this pull request Apr 2, 2022
TrueBrain added a commit to TrueBrain/OpenTTD that referenced this pull request Apr 2, 2022
TrueBrain added a commit to TrueBrain/OpenTTD that referenced this pull request Apr 2, 2022
TrueBrain added a commit that referenced this pull request Apr 2, 2022
@TrueBrain TrueBrain added backported This PR is backported to a current release (RC / stable) and removed backport requested This PR should be backport to current release (RC / stable) labels Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR is backported to a current release (RC / stable)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Destroying road when local authority doesn't allow it gives the wrong error message
3 participants