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 hasEnoughPower() check in ARL #2365

Merged
merged 2 commits into from Feb 4, 2024

Conversation

serenibyss
Copy link
Member

Fixes the hasEnoughEnergy() check in ARL requiring the energy buffer to be more full than necessary for some setups. Some examples where this behavior was not ideal previously:

  • Charging a singleblock machine just with a battery, the battery will now only fill the machine buffer to 33% full. This is often not enough power to start a recipe with the old logic.
  • Multiblocks with very large capacity energy hatches, such as if an addon allowed a laser hatch in a multiblock, could require millions or more EU in the buffer to even start, which may take a very long time to fill, even if your input EU/t is more than enough to run the recipe successfully

The overrides were so that our old logic for steam machines could remain, requiring a full buffer before starting as a more forgiving early game feature

@serenibyss serenibyss added the type: bug Something isn't working label Jan 30, 2024
@serenibyss serenibyss requested a review from a team as a code owner January 30, 2024 01:54
Copy link
Contributor

@ALongStringOfNumbers ALongStringOfNumbers left a comment

Choose a reason for hiding this comment

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

Does this also need to be applied to the primitive recipe logic?

@serenibyss
Copy link
Member Author

Does this also need to be applied to the primitive recipe logic?

Primitive logic sets the stored and the capacity to max int, so it will still always pass this check. However, overriding this method even if technically unnecessary seems like a nice bit of safety to add so I'll add it

@serenibyss serenibyss merged commit be62b40 into master Feb 4, 2024
3 checks passed
@serenibyss serenibyss deleted the sb-fix-has-enough-power-recipelogic branch February 4, 2024 20:27
serenibyss added a commit that referenced this pull request Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants