From 6b46a0403000f99ec3024cc093bb44ea60edd0db Mon Sep 17 00:00:00 2001 From: MysterD Date: Thu, 14 Apr 2022 19:40:37 -0700 Subject: [PATCH] Fixed wiggler dialog crash --- src/game/behaviors/wiggler.inc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/behaviors/wiggler.inc.c b/src/game/behaviors/wiggler.inc.c index d5d9b768..e8bc5d10 100644 --- a/src/game/behaviors/wiggler.inc.c +++ b/src/game/behaviors/wiggler.inc.c @@ -311,9 +311,10 @@ static void wiggler_act_jumped_on(void) { // Wait for a second after unsquishing, then show text and either shrink (if // defeated) or go back to walking + s16 dialogIndex = (o->oHealth - 2); if (o->header.gfx.scale[1] >= 4.0f) { if (o->oTimer > 30) { - if (should_start_or_continue_dialog(marioState, o) && cur_obj_update_dialog_with_cutscene(marioState, 2, 0, CUTSCENE_DIALOG, *attackText[o->oHealth - 2], wiggler_act_jumped_on_continue_dialog) != 0) { + if ((dialogIndex >= 0 && dialogIndex <= 2) && should_start_or_continue_dialog(marioState, o) && cur_obj_update_dialog_with_cutscene(marioState, 2, 0, CUTSCENE_DIALOG, *attackText[dialogIndex], wiggler_act_jumped_on_continue_dialog) != 0) { // Because we don't want the wiggler to disappear after being // defeated, we leave its health at 1 if (--o->oHealth <= 1) {