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 #12594: Give descriptive error when company takeover fails due to vehicle limit #12676

Merged
merged 1 commit into from
May 13, 2024

Conversation

2TallTyler
Copy link
Member

@2TallTyler 2TallTyler commented May 13, 2024

Motivation / Problem

As per #12594, company takeovers that fail due to vehicle limit do not explain why beyond an error, "Can't buy company..."

Description

Clarify the reason with an existing error string and clarify the comment. Despite its broad name, MayCompanyTakeOver() only checks vehicle limits.

Closes #12594.

Limitations

Does not strictly need backporting, but no languages are changed so I don't see a reason to exclude it.

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, game_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@2TallTyler 2TallTyler added the backport requested This PR should be backport to current release (RC / stable) label May 13, 2024
src/economy.cpp Outdated Show resolved Hide resolved
@2TallTyler 2TallTyler merged commit 9f63b9f into OpenTTD:master May 13, 2024
15 checks passed
@2TallTyler 2TallTyler deleted the vehicle-limit branch May 13, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport requested This PR should be backport to current release (RC / stable)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: No descriptive error when hostile takeover fails due to vehicle limit
2 participants