Fix gLevelValues.numCoinsToLife div/0 error (#500)

This commit is contained in:
Sunk 2024-11-19 16:48:11 -05:00 committed by GitHub
parent d10e7c758e
commit 382b03d97f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -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++;
}

View file

@ -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);
}