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 health scaling again #3778

Merged
merged 1 commit into from
Jan 8, 2023

Conversation

vectrixdevelops
Copy link
Contributor

@vectrixdevelops vectrixdevelops commented Oct 15, 2022

My first attempt did not fix the problem correctly, so I've made another fix. This correctly takes into account the maximum health when the health scale is not set. This also caches the maximum attribute to use in calls to getInternalScaledHealth as an optimization. It removes some of the duplicate code in getInternalScaledHealth to instead use the cached attributes and calling getValue to acquire the numeric maximum health value (taking into account modifiers applied by mods).

@vectrixdevelops vectrixdevelops changed the title (WIP) Fix health scaling again Fix health scaling again Oct 16, 2022
@Zidane Zidane merged commit a060038 into SpongePowered:api-8 Jan 8, 2023
@vectrixdevelops vectrixdevelops deleted the fix/health-scale branch January 14, 2023 05:53
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.

2 participants