From 382b03d97f589a540605f2f7ec53e84e7f896ff6 Mon Sep 17 00:00:00 2001 From: Sunk <69110309+Sunketchupm@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:48:11 -0500 Subject: [PATCH] Fix gLevelValues.numCoinsToLife div/0 error (#500) --- src/game/ingame_menu.c | 2 +- src/game/level_update.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c index a559852e8..bf7304bf2 100644 --- a/src/game/ingame_menu.c +++ b/src/game/ingame_menu.c @@ -3269,7 +3269,7 @@ void print_hud_course_complete_coins(s16 x, s16 y) { gMarioStates[0].numLives++; } } else { - if (gCourseCompleteCoins % gLevelValues.numCoinsToLife == 0 && gCourseCompleteCoins > 0) { + if (gLevelValues.numCoinsToLife != 0 && gCourseCompleteCoins % gLevelValues.numCoinsToLife == 0 && gCourseCompleteCoins > 0) { play_sound(SOUND_GENERAL_COLLECT_1UP, gGlobalSoundSource); gMarioStates[0].numLives++; } diff --git a/src/game/level_update.c b/src/game/level_update.c index 34e275981..b14fa4698 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -1121,7 +1121,7 @@ void update_hud_values(void) { play_sound(SOUND_GENERAL_COLLECT_1UP, gGlobalSoundSource); } } else { - if (gHudDisplay.coins % gLevelValues.numCoinsToLife == 0 && gHudDisplay.coins > 0) { + if (gLevelValues.numCoinsToLife != 0 && gHudDisplay.coins % gLevelValues.numCoinsToLife == 0 && gHudDisplay.coins > 0) { gMarioState->numLives++; play_sound(SOUND_GENERAL_COLLECT_1UP, gGlobalSoundSource); }