diff options
| author | Tal Hayon <talhayon1@gmail.com> | 2022-05-13 10:38:19 +0300 |
|---|---|---|
| committer | Tal Hayon <talhayon1@gmail.com> | 2022-05-13 10:38:19 +0300 |
| commit | d1109a642f2e5521946ab911d9a0dc4e7541dc6f (patch) | |
| tree | de582ff922039a4c193fee25aa08e5394f67589a /src | |
| parent | 4cd8aa9ab6a05f8d3d06b201418bd50e7d5c9c87 (diff) | |
Match sub_08039858
Diffstat (limited to 'src')
| -rw-r--r-- | src/enemy/stalfos.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/enemy/stalfos.c b/src/enemy/stalfos.c index 9fea0d69..457d7c59 100644 --- a/src/enemy/stalfos.c +++ b/src/enemy/stalfos.c @@ -324,28 +324,23 @@ void sub_0803981C(StalfosEntity* this) { EnqueueSFX(SFX_12B); } -NONMATCH("asm/non_matching/stalfos/sub_08039858.inc", void sub_08039858(StalfosEntity* this)) { +void sub_08039858(StalfosEntity* this) { s32 iVar1; u32 uVar2; - u32 uVar3; - u32 tmp; iVar1 = sub_080398C0(this); - uVar2 = (u32)super->animationState; - tmp = uVar2 * 8; - if (((iVar1 + 4U) & 0x18) == tmp) { + uVar2 = (u32)super->animationState * 8; + if (((iVar1 + 4U) & 0x18) == uVar2) { if (this->unk_7b != 3) { return; } this->unk_7b = 0; - uVar3 = Random(); - iVar1 += ((uVar3 & 2) - 1) * 8; + iVar1 += ((Random() & 2) - 1) * 8; } - uVar2 = ((iVar1 + uVar2 * -8) & 0x1f) >> 4 ^ 1; + uVar2 = ((iVar1 - uVar2) & 0x1f) >> 4 ^ 1; InitAnimationForceUpdate(super, gUnk_080CF8F8[(u32)super->animationState * 2 + uVar2]); super->animationState = ((uVar2 * 2 + super->animationState) - 1) & 3; } -END_NONMATCH u32 sub_080398C0(StalfosEntity* this) { u32 rand = Random(); |
