From 7c7fbef8f9031282defb65d803f4fa6b1f4739fa Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Sat, 21 May 2022 19:19:54 +0300 Subject: Match sub_08021274 --- src/enemy/darkNut.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3