summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTal Hayon <talhayon1@gmail.com>2022-05-21 19:19:54 +0300
committerTal Hayon <talhayon1@gmail.com>2022-05-21 19:19:54 +0300
commit7c7fbef8f9031282defb65d803f4fa6b1f4739fa (patch)
tree74ee99ee51f7950c062e645b77fd998b564d85ad /src
parent6bb4086f60ccd5e5c39de1a2de2875cdc4d740fb (diff)
Match sub_08021274
Diffstat (limited to 'src')
-rw-r--r--src/enemy/darkNut.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c
index 4f948162..ae29107c 100644
--- a/src/enemy/darkNut.c
+++ b/src/enemy/darkNut.c
@@ -392,7 +392,17 @@ void sub_0802124C(Entity* this) {
}
}
-ASM_FUNC("asm/non_matching/darkNut/sub_08021274.inc", u32 sub_08021274(u32 a, u32 b))
+u32 sub_08021274(u32 animationState, u32 dir) {
+ if (((dir & 7) - 3 < 3) && (((dir & 0x18) >> 3 == animationState || (((dir + 8) & 0x18) >> 3 == animationState)))) {
+ return 0xff;
+ }
+
+ dir = DirectionToAnimationState(DirectionRoundUp(dir));
+ if (animationState == dir) {
+ return 0xff;
+ }
+ return dir;
+}
void sub_080212B0(Entity* this) {
u8 tmp;