Fix issue where visually the HUD shows you have 0 hearts when you dont#1089
Merged
codeHusky merged 2 commits intosmartcmd:mainfrom Mar 10, 2026
Merged
Fix issue where visually the HUD shows you have 0 hearts when you dont#1089codeHusky merged 2 commits intosmartcmd:mainfrom
codeHusky merged 2 commits intosmartcmd:mainfrom
Conversation
Collaborator
|
should use the modern style casts in-line with the rest of the project (static_cast and whatnot) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is something 4J Studios fixed in TU20 (https://minecraft.fandom.com/wiki/Xbox_360_Edition_TU20)

4J also used ceil() in TU20 so this code is the exact same changes they made

Changes
Previous Behavior
HUD would display you have 0 hearts when you have a half of a heart.
Root Cause
The game was casting the float to a int which truncated the decimal.
New Behavior
HUD will now show half of a heart instead of none.
Fix Implementation
Use ceil() to prevent the decimal being truncated.
AI Use Disclosure
No AI was used.
Related Issues