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 #10135: Cost of building multiple objects might not match test #10137

Merged
merged 1 commit into from Nov 5, 2022

Conversation

2TallTyler
Copy link
Member

Motivation / Problem

As reported in #10135 (thanks @James103 for the excellent diagnosis!), objects might not consent to being built based on the locations of other objects built within the same command — for example distance restrictions between wind turbines in OpenGFX+ Landscape.

This creates an assertion because the test command and the exec command don't match costs.

Description

Add the CMD_NO_TEST flag to CmdBuildObjectArea to tell OpenTTD we're okay with this potential difference in cost.

Closes #10135.

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

@2TallTyler 2TallTyler added the size: trivial This Pull Request is trivial label Nov 5, 2022
@2TallTyler 2TallTyler merged commit 0172eb3 into OpenTTD:master Nov 5, 2022
@2TallTyler 2TallTyler deleted the object_estimate branch November 5, 2022 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: trivial This Pull Request is trivial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Crash]: Crash trying to build objects on area
2 participants