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: Trivial autoreplace of mixed cargo articulated engines #11253

Conversation

JGRennison
Copy link
Contributor

Motivation / Problem

Autoreplace/autorenew currently fails for mixed cargo articulated engines, even when there is no reason to do so.

Description

Do not fail autoreplace/autorenew of mixed cargo articulated engines due to an inability to refit to mixed cargoes, when no refit is required because the target engine already has a suitable set of cargoes.
Notably, this allows autorenew (autoreplace to same engine type) to succeed.

Limitations

N/A

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

@JGRennison JGRennison force-pushed the fix-trivial-autoreplace-of-mixed-cargo-articulated-vehicles branch from ab7077d to 085c6aa Compare September 1, 2023 22:21
@andythenorth
Copy link
Contributor

I can't review the code, but this addresses a long-standing issue and would be an improvement to OpenTTD. Low-to-no chance of pitchforks.

@2TallTyler 2TallTyler force-pushed the fix-trivial-autoreplace-of-mixed-cargo-articulated-vehicles branch from 085c6aa to ae8301f Compare November 3, 2023 15:36
2TallTyler
2TallTyler previously approved these changes Nov 3, 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.

Code looks fine to me, and this does seem like an easy fix to a long-standing problem.

@2TallTyler
Copy link
Member

Needs a rebase now. 😕

@2TallTyler 2TallTyler added the work: needs rebase This Pull Request needs a rebase label Nov 16, 2023
@2TallTyler 2TallTyler added this to the 14.0 milestone Nov 17, 2023
Do not fail autoreplace/autorenew of mixed cargo articulated engines
due to an inability to refit to mixed cargoes, when no refit is
required because the target engine already has a suitable set of cargoes.
Notably, this allows autorenew (autoreplace to same engine type)
to succeed.
@JGRennison JGRennison force-pushed the fix-trivial-autoreplace-of-mixed-cargo-articulated-vehicles branch from ae8301f to 0891329 Compare November 19, 2023 10:44
@2TallTyler 2TallTyler removed the work: needs rebase This Pull Request needs a rebase label Nov 19, 2023
@glx22 glx22 merged commit 9822fa6 into OpenTTD:master Nov 20, 2023
20 checks passed
@JGRennison JGRennison deleted the fix-trivial-autoreplace-of-mixed-cargo-articulated-vehicles branch January 9, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants