Fix piranha plant hitboxes (#355)

Bug reported in #150
This commit is contained in:
Sunk 2024-10-08 03:02:05 -04:00 committed by GitHub
parent 9adf922c08
commit 8a62dfbdac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {