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

RM13 premature shutdown fix, the Sequel: I need to learn how to Github better #77023

Merged
merged 6 commits into from
Oct 16, 2024

Conversation

DPavonis
Copy link
Contributor

Summary

Bugfixes "Fixed RM13 premature shutdown issue"

Purpose of change

Fixes #76926

Describe the solution

Adjusted the logic of the USE_POWER_WHEN_HIT if block in armor_absorb() so that instead of checking if the amount of incoming damage converted to kJ is greater than the amount of energy consumed by that attack, then deactivating, incoming damage in kJ is compared to the amount of energy remaining.

Added a new bool to energy_remaining() to allow for only checking the item's batteries, excluding UPS, bionic power and vehicle power.

Describe alternatives you've considered

1.) Letting someone more competent than I am fix it.
2.) Making the else block a more explicit else if block that checks if the incoming damage is less than the remaining energy. Just an if block was causing a drain on the suit when off. Made check explicit.

Testing

Loaded the save provided in #76926 with my proposed fix, held the wait button until the armor shut down at the appropriate time, opened up the log and observed the expected unique shutdown message was present.

Additional context

Somehow accidentally closed #76987 while dealing with merge conflicts.

Leaving this as a draft for the moment for feedback and in case I'm missing something.

TODO: add check in energy_remaining calls for either UPS or bionic energy toolmods to cover future use cases.
Eh. Do this in a future PR.

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Items: Armor / Clothing Armor and clothing <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Oct 13, 2024
@Maleclypse Maleclypse merged commit 8c9ca7a into CleverRaven:master Oct 16, 2024
23 of 28 checks passed
@DPavonis DPavonis deleted the USE_POWER_WHEN_HIT_adjustment branch October 16, 2024 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Items: Armor / Clothing Armor and clothing json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RM13 combat armor turns off mid combat
2 participants