Draft: Fix infinite loop when Force Shield has 256 HP
I set powers[pw_shield]
to SH_FORCE|SH_FORCEHP
just to see what that would look like in the HUD, and the game just froze. A quick look with GDB told me it was in an infinite loop, as it was checking i <= 255
when i
is a UINT8
. So I just changed it to a UINT16
, which I verified fixes the bug.
Merge request reports
Activity
As I've mentioned before in
#hardcoding
, a better solution to this would be to just draw the shield's HP as a+n
wheren
is the number of charges above 2 over the icon in the same fashion the other powerups do. The way the Force Shield icons normally stack all over the screen even in numbers not that high is just too intrusive not to address.
added Bug label
added 2381 commits
-
128616d1...a68440c4 - 2380 commits from branch
STJr:next
- 49407fbe - Merge branch SRB2:next into forcehp_hud_fix
-
128616d1...a68440c4 - 2380 commits from branch
added 775 commits
-
49407fbe...2747e30f - 774 commits from branch
STJr:next
- d6ba7723 - Merge branch SRB2:next into forcehp_hud_fix
-
49407fbe...2747e30f - 774 commits from branch
mentioned in merge request !2378 (merged)
Closing this in favor of !2378 (merged)