From f18a3fef7d33f3595c971db9bb22fd51c43d7b39 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+AgentXLP@users.noreply.github.com> Date: Mon, 10 Jun 2024 08:06:21 -0400 Subject: [PATCH] Fix power meter crash --- src/game/level_update.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/level_update.c b/src/game/level_update.c index e976d9d8..98c389d4 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -1094,7 +1094,7 @@ void initiate_delayed_warp(void) { void update_hud_values(void) { if (gCurrCreditsEntry == NULL) { - s16 numHealthWedges = gMarioState->health > 0 ? gMarioState->health >> 8 : 0; + s16 numHealthWedges = gMarioState->health > 0 ? MIN(gMarioState->health >> 8, 8) : 0; if (gCurrCourseNum >= COURSE_MIN) { gHudDisplay.flags |= HUD_DISPLAY_FLAG_COIN_COUNT;