Skip to content

Commit 382b03d

Browse files
authored
Fix gLevelValues.numCoinsToLife div/0 error (#500)
1 parent d10e7c7 commit 382b03d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/game/ingame_menu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3269,7 +3269,7 @@ void print_hud_course_complete_coins(s16 x, s16 y) {
32693269
gMarioStates[0].numLives++;
32703270
}
32713271
} else {
3272-
if (gCourseCompleteCoins % gLevelValues.numCoinsToLife == 0 && gCourseCompleteCoins > 0) {
3272+
if (gLevelValues.numCoinsToLife != 0 && gCourseCompleteCoins % gLevelValues.numCoinsToLife == 0 && gCourseCompleteCoins > 0) {
32733273
play_sound(SOUND_GENERAL_COLLECT_1UP, gGlobalSoundSource);
32743274
gMarioStates[0].numLives++;
32753275
}

src/game/level_update.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ void update_hud_values(void) {
11211121
play_sound(SOUND_GENERAL_COLLECT_1UP, gGlobalSoundSource);
11221122
}
11231123
} else {
1124-
if (gHudDisplay.coins % gLevelValues.numCoinsToLife == 0 && gHudDisplay.coins > 0) {
1124+
if (gLevelValues.numCoinsToLife != 0 && gHudDisplay.coins % gLevelValues.numCoinsToLife == 0 && gHudDisplay.coins > 0) {
11251125
gMarioState->numLives++;
11261126
play_sound(SOUND_GENERAL_COLLECT_1UP, gGlobalSoundSource);
11271127
}

0 commit comments

Comments
 (0)