From 8a62dfbdacc515a52a5e38673b7fc3bc89f7a1be Mon Sep 17 00:00:00 2001 From: Sunk <69110309+Sunketchupm@users.noreply.github.com> Date: Tue, 8 Oct 2024 03:02:05 -0400 Subject: [PATCH] Fix piranha plant hitboxes (#355) Bug reported in #150 --- src/game/behaviors/piranha_plant.inc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/game/behaviors/piranha_plant.inc.c b/src/game/behaviors/piranha_plant.inc.c index 3ed0a414..826802f9 100644 --- a/src/game/behaviors/piranha_plant.inc.c +++ b/src/game/behaviors/piranha_plant.inc.c @@ -122,6 +122,7 @@ void piranha_plant_act_woken_up(void) { */ o->oDamageOrCoinValue = 3; #endif + if (o->oTimer == 0) stop_secondary_music(50); @@ -270,6 +271,9 @@ void piranha_plant_act_biting(void) { cur_obj_init_animation_with_sound(0); + cur_obj_set_hitbox_radius_and_height(150.0f, 100.0f); + cur_obj_set_hurtbox_radius_and_height(150.0f, 100.0f); + // Play a bite sound effect on certain frames. if (is_item_in_array(frame, sPiranhaPlantBiteSoundFrames)) { cur_obj_play_sound_2(SOUND_OBJ2_PIRANHA_PLANT_BITE); @@ -368,9 +372,6 @@ void bhv_piranha_plant_loop(void) { sync_object_init_field(o, &o->oTimer); } - cur_obj_set_hitbox_radius_and_height(150.0f, 100.0f); - cur_obj_set_hurtbox_radius_and_height(150.0f, 100.0f); - CUR_OBJ_CALL_ACTION_FUNCTION(TablePiranhaPlantActions); // In WF, hide all Piranha Plants once high enough up. if (gCurrLevelNum == LEVEL_WF) {