summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfig02 <fig02srl@gmail.com>2024-03-29 11:27:34 -0400
committerGitHub <noreply@github.com>2024-03-29 11:27:34 -0400
commit86bd6e923239c6d9d1bc0fb317ffc8f10eada581 (patch)
tree4017533a0d2a2a00d82d7761fe6bbafca467489c /src
parent4e1b0f66943b2748d8ac2439176e2ddae9dc13b1 (diff)
Document en_ba damage bug (#1934)
* comment on en_ba collision bug * format
Diffstat (limited to 'src')
-rw-r--r--src/overlays/actors/ovl_En_Ba/z_en_ba.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c
index 97fd430c4..133cffe45 100644
--- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c
+++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c
@@ -235,6 +235,7 @@ void EnBa_SwingAtPlayer(EnBa* this, PlayState* play) {
s16 phi_fp;
Math_SmoothStepToF(&this->actor.world.pos.y, this->actor.home.pos.y + 60.0f, 1.0f, 10.0f, 0.0f);
+
if ((this->actor.xzDistToPlayer <= 175.0f) || (this->unk_31A != 0)) {
if (this->unk_318 == 20) {
Actor_PlaySfx(&this->actor, NA_SE_EN_BALINADE_HAND_UP);
@@ -300,16 +301,22 @@ void EnBa_SwingAtPlayer(EnBa* this, PlayState* play) {
}
this->unk_2A8[13].x = this->unk_2A8[12].x;
this->unk_2A8[13].y = this->unk_2A8[12].y;
+
+ //! @bug This code being located here gives multiple opportunities for the current action to change
+ //! before damage handling can be done.
+ //! By, for example, taking damage on the same frame the collider contacts Player, a different action
+ //! will run and `AT_HIT` will remain set. Then when returning back to this action, Player
+ //! will get knocked back instantly, even though there was no apparent collision.
+ //! Handling `AT_HIT` directly in Update, where it can run every frame, would help catch these edge cases.
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT;
if (this->collider.base.at == &player->actor) {
func_8002F71C(play, &this->actor, 8.0f, this->actor.yawTowardsPlayer, 8.0f);
}
}
+
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
- return;
- }
- if ((this->actor.xzDistToPlayer > 175.0f) || (player->stateFlags1 & PLAYER_STATE1_26)) {
+ } else if ((this->actor.xzDistToPlayer > 175.0f) || (player->stateFlags1 & PLAYER_STATE1_26)) {
EnBa_SetupIdle(this);
} else {
EnBa_SetupSwingAtPlayer(this);