diff options
| author | Tal Hayon <talhayon1@gmail.com> | 2022-08-10 22:04:06 +0300 |
|---|---|---|
| committer | Tal Hayon <talhayon1@gmail.com> | 2022-08-10 22:04:06 +0300 |
| commit | 5b44390e0e668b4386875d47f668399f8470fd2d (patch) | |
| tree | 4ffaf4319f949bcfa6aba2699489e74ff359f19c /src/enemy/wallMaster2.c | |
| parent | dd59d70447cab4676e66895440fe6809d092bd31 (diff) | |
Match sub_0802CF8C
Diffstat (limited to 'src/enemy/wallMaster2.c')
| -rw-r--r-- | src/enemy/wallMaster2.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/enemy/wallMaster2.c b/src/enemy/wallMaster2.c index 696b36ad..2669bddd 100644 --- a/src/enemy/wallMaster2.c +++ b/src/enemy/wallMaster2.c @@ -165,23 +165,26 @@ void sub_0802CF64(Entity* this) { sub_0802CF8C(this); } -NONMATCH("asm/non_matching/wallMaster2/sub_0802CF8C.inc", void sub_0802CF8C(Entity* this)) { +void sub_0802CF8C(Entity* this) { int iVar1; - u32 uVar2; + u32 dir; const u16* ptr; - u16* ptr2; - uVar2 = (this->direction + 2) & 0x1c; - if ((uVar2 - this->animationState * 4 + 6 > 0xc) || - ((((this->direction + 1) & 7) > 2 && (uVar2 >> 2 != this->animationState)))) { - this->animationState = (uVar2 >> 2); - iVar1 = (uVar2 >> 3) * 2; + dir = Direction8RoundUp(this->direction); + if (dir - Direction8FromAnimationState(this->animationState) + 6 > 12) { + this->animationState = Direction8ToAnimationState(dir); + iVar1 = (dir >> 3) * 2; + ptr = &gUnk_080CD730[iVar1]; + this->field_0x74.HWORD = ptr[0]; + this->field_0x76.HWORD = ptr[1]; + } else if (((this->direction + 1) & 7) > 2 && (Direction8ToAnimationState(dir) != this->animationState)) { + this->animationState = Direction8ToAnimationState(dir); + iVar1 = (dir >> 3) * 2; ptr = &gUnk_080CD730[iVar1]; this->field_0x74.HWORD = ptr[0]; this->field_0x76.HWORD = ptr[1]; } } -END_NONMATCH void sub_0802CFD8(Entity* this) { u32 unk = gUnk_080CD740[(this->field_0x7a.HALF.LO++ >> 3) & 7]; |
