From 3c34acbbf4d36931fec3af8b403aa19657075a7b Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Wed, 5 Oct 2022 12:47:55 +0200 Subject: [PATCH] EnFz_ApplyDamage match fixup --- src/overlays/actors/ovl_En_Fz/z_en_fz.c | 31 ++++++++++++++----------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index 74907881be..46eed1d212 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -341,11 +341,11 @@ void EnFz_ApplyDamage(EnFz* this, PlayState* play) { this->collider1.base.acFlags &= ~AC_HIT; } else if (this->collider1.base.acFlags & AC_HIT) { this->collider1.base.acFlags &= ~AC_HIT; - if (this->actor.colChkInfo.damageEffect != 2) { - if (this->actor.colChkInfo.damageEffect == 0xF) { + switch (this->actor.colChkInfo.damageEffect) { + case 0xF: Actor_ApplyDamage(&this->actor); Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 8); - if (this->actor.colChkInfo.health) { + if (this->actor.colChkInfo.health != 0) { Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DAMAGE); vec.x = this->actor.world.pos.x; vec.y = this->actor.world.pos.y; @@ -361,16 +361,21 @@ void EnFz_ApplyDamage(EnFz* this, PlayState* play) { EnFz_Damaged(this, play, &vec, 30, 10.0f); EnFz_SetupDespawn(this, play); } - } - } else { - Actor_ApplyDamage(&this->actor); - Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 8); - if (this->actor.colChkInfo.health == 0) { - Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DEAD); - EnFz_SetupMelt(this); - } else { - Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DAMAGE); - } + break; + + case 2: + Actor_ApplyDamage(&this->actor); + Actor_SetColorFilter(&this->actor, 0x4000, 0xFF, 0x2000, 8); + if (this->actor.colChkInfo.health == 0) { + Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DEAD); + EnFz_SetupMelt(this); + } else { + Audio_PlayActorSfx2(&this->actor, NA_SE_EN_FREEZAD_DAMAGE); + } + break; + + default: + break; } } }