Skip to content

[Fix] Prevent numeric 100 hp turning into percents#73

Open
Remuchi wants to merge 1 commit intolejeffe:masterfrom
Remuchi:fix-100-hp
Open

[Fix] Prevent numeric 100 hp turning into percents#73
Remuchi wants to merge 1 commit intolejeffe:masterfrom
Remuchi:fix-100-hp

Conversation

@Remuchi
Copy link
Copy Markdown

@Remuchi Remuchi commented Mar 27, 2026

Since the plugin checked if monster had exactly 100 hp as being "default", it let to the issue that made monsters hp jump e.g. 120 -> 40 -> 90. Now it's displayed correctly and default hp value was changed to -1 for consistency with RuneLite's Actor class.

image

Signed-off-by: Remuchi <RemuchiOfficial@gmail.com>
@xines
Copy link
Copy Markdown
Collaborator

xines commented Mar 28, 2026

Hello thanks for taking the time to write a fix, this indeed is a very niche problem that occurs due to the wnpc.getCurrentHp() == 100 check that would trigger on npcs with total health higher than 100 and having been hit to exactly 100 current health making them also pass the second check wnpc.getHealthRatio() < 100.0.

That said i think i'll add a more proper way of dealing with this and give you credits. 😄 👍

xines added a commit to xines/MonsterHP that referenced this pull request Mar 28, 2026
…for the find.

Switched math rounding down to nearest, if this is becomes a issue we can easly patch.

Also implements per npc low health color support, that i somehow forgot to submit.
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