diff --git a/asm/enemy/ballChainSoldier.s b/asm/enemy/ballChainSoldier.s index e5176211..907efd54 100644 --- a/asm/enemy/ballChainSoldier.s +++ b/asm/enemy/ballChainSoldier.s @@ -791,7 +791,7 @@ sub_0803EAD0: @ 0x0803EAD0 movs r4, #0x32 ldrsh r2, [r2, r4] subs r2, #4 - bl isEntityWithinDistance + bl EntityWithinDistance pop {r4, pc} .align 2, 0 _0803EAE8: .4byte gUnk_020000B0 diff --git a/asm/enemy/enemy4D.s b/asm/enemy/enemy4D.s index a0d7b849..a44c1797 100644 --- a/asm/enemy/enemy4D.s +++ b/asm/enemy/enemy4D.s @@ -39,7 +39,7 @@ _0803EBE4: ldrh r2, [r0] adds r0, r4, #0 movs r3, #2 - bl isEntityWithinDistance + bl EntityWithinDistance cmp r0, #0 bne _0803EC14 movs r0, #4 @@ -141,7 +141,7 @@ sub_0803EC94: @ 0x0803EC94 ldrh r2, [r6] adds r0, r4, #0 movs r3, #1 - bl isEntityWithinDistance + bl EntityWithinDistance cmp r0, #0 beq _0803ECD8 ldrh r0, [r5] @@ -465,7 +465,7 @@ sub_0803EF04: @ 0x0803EF04 movs r4, #0x32 ldrsh r2, [r2, r4] subs r2, #4 - bl isEntityWithinDistance + bl EntityWithinDistance pop {r4, pc} .align 2, 0 _0803EF1C: .4byte gUnk_020000B0 @@ -531,7 +531,7 @@ sub_0803EF74: @ 0x0803EF74 ldrsh r2, [r4, r0] adds r0, r5, #0 movs r3, #0x50 - bl isEntityWithinDistance + bl EntityWithinDistance cmp r0, #0 beq _0803EFA8 adds r0, r4, #0 diff --git a/asm/enemy/enemy64.s b/asm/enemy/enemy64.s index b14d0243..4e9da8ce 100644 --- a/asm/enemy/enemy64.s +++ b/asm/enemy/enemy64.s @@ -449,7 +449,7 @@ _08049398: asrs r3, r3, #0x10 adds r3, #0x10 adds r0, r4, #0 - bl isEntityWithinDistance + bl EntityWithinDistance cmp r0, #0 beq _080493E0 movs r0, #2 @@ -661,7 +661,7 @@ sub_08049538: @ 0x08049538 adds r2, #0x80 adds r0, r4, #0 movs r3, #0x70 - bl isEntityWithinDistance + bl EntityWithinDistance adds r1, r0, #0 cmp r1, #0 bne _0804956E @@ -754,7 +754,7 @@ sub_080495F8: @ 0x080495F8 adds r2, #0x80 adds r0, r4, #0 movs r3, #0x28 - bl isEntityWithinDistance + bl EntityWithinDistance cmp r0, #0 beq _0804963C movs r0, #2 @@ -1195,7 +1195,7 @@ sub_08049944: @ 0x08049944 movs r3, #0x32 ldrsh r2, [r5, r3] movs r3, #0x20 - bl isEntityWithinDistance + bl EntityWithinDistance cmp r0, #0 beq _0804998C ldr r2, _08049994 @ =gPlayerState @@ -1292,7 +1292,7 @@ sub_080499F0: @ 0x080499F0 ldrsh r2, [r4, r3] adds r0, r5, #0 movs r3, #0x24 - bl isEntityWithinDistance + bl EntityWithinDistance cmp r0, #0 beq _08049A7E ldrb r1, [r6] diff --git a/asm/enemy/stalfos.s b/asm/enemy/stalfos.s index 42ded808..69d6ee51 100644 --- a/asm/enemy/stalfos.s +++ b/asm/enemy/stalfos.s @@ -671,7 +671,7 @@ _0803976A: ldrsh r2, [r0, r3] adds r0, r4, #0 movs r3, #0x24 - bl isEntityWithinDistance + bl EntityWithinDistance cmp r0, #0 beq _08039818 movs r0, #5 @@ -713,7 +713,7 @@ _080397DC: ldrsh r2, [r0, r3] adds r0, r4, #0 movs r3, #0x48 - bl isEntityWithinDistance + bl EntityWithinDistance cmp r0, #0 beq _08039818 movs r0, #8 @@ -844,7 +844,7 @@ sub_080398C0: @ 0x080398C0 ldrsh r2, [r0, r3] adds r0, r4, #0 movs r3, #0x58 - bl isEntityWithinDistance + bl EntityWithinDistance cmp r0, #0 beq _08039908 ldr r1, _08039904 @ =gPlayerEntity diff --git a/asm/enemy/wizzrobeWind.s b/asm/enemy/wizzrobeWind.s index 3ed9873a..696bf972 100644 --- a/asm/enemy/wizzrobeWind.s +++ b/asm/enemy/wizzrobeWind.s @@ -789,7 +789,7 @@ sub_0802FA88: @ 0x0802FA88 adds r6, #0x7a ldrh r2, [r6] movs r3, #2 - bl isEntityWithinDistance + bl EntityWithinDistance cmp r0, #0 beq _0802FAF6 adds r1, r4, #0 diff --git a/asm/non_matching/mandiblesProjectile/sub_080AA374.inc b/asm/non_matching/mandiblesProjectile/sub_080AA374.inc index 7c51ea50..be832413 100644 --- a/asm/non_matching/mandiblesProjectile/sub_080AA374.inc +++ b/asm/non_matching/mandiblesProjectile/sub_080AA374.inc @@ -34,7 +34,7 @@ adds r2, r2, r0 adds r0, r6, #0 movs r3, #8 - bl isEntityWithinDistance + bl EntityWithinDistance cmp r0, #0 beq _080AA3D0 movs r0, #1 diff --git a/asm/object/evilSpirit.s b/asm/object/evilSpirit.s index 8aa425f4..c9e4c0f0 100644 --- a/asm/object/evilSpirit.s +++ b/asm/object/evilSpirit.s @@ -555,7 +555,7 @@ _0808663A: adds r0, r7, #0 adds r1, r4, #0 movs r3, #2 - bl isEntityWithinDistance + bl EntityWithinDistance cmp r0, #0 beq _080866B8 movs r0, #1 diff --git a/asm/object/object36.s b/asm/object/object36.s index c697fb62..e46576e4 100644 --- a/asm/object/object36.s +++ b/asm/object/object36.s @@ -297,7 +297,7 @@ _0808BD34: subs r2, #6 adds r0, r5, #0 movs r3, #0x1c - bl isEntityWithinDistance + bl EntityWithinDistance cmp r0, #0 beq _0808BDAE adds r0, r5, #0 diff --git a/include/functions.h b/include/functions.h index 0fba11a2..07f6a0e9 100644 --- a/include/functions.h +++ b/include/functions.h @@ -95,7 +95,7 @@ extern u32 sub_080040D8(Entity*, u8*, s32, s32); extern u32 sub_0805F8F8(u32); extern u32 sub_0805F7A0(u32); extern u32* sub_0805F25C(u32); -u32 isEntityWithinDistance(Entity*, s32, s32, s32); +u32 EntityWithinDistance(Entity*, s32, s32, s32); extern void LinearMoveAngle(Entity*, u32, u32); extern void sub_080A1ED0(u32, u32, u32); extern u32 sub_0806F5B0(u32); diff --git a/src/coord.c b/src/coord.c index f9d02f5a..ef5f2c12 100644 --- a/src/coord.c +++ b/src/coord.c @@ -7,8 +7,8 @@ #include "room.h" #include "functions.h" -const u8 gEntityOnTopArray[]; -const u8 gEntityBelowArray[]; +const u8 gSpriteSortAboveTable[]; +const u8 gSpriteSortBelowTable[]; const u8 gUnk_08114F58[]; const u8 gUnk_08114F38[]; @@ -360,11 +360,11 @@ void sub_0806FA90(Entity* source, Entity* target, s32 offsetX, s32 offsetY) { } void SortEntityAbove(Entity* param_1, Entity* param_2) { - param_2->spritePriority.b0 = gEntityOnTopArray[param_1->spritePriority.b0]; + param_2->spritePriority.b0 = gSpriteSortAboveTable[param_1->spritePriority.b0]; } void SortEntityBelow(Entity* param_1, Entity* param_2) { - param_2->spritePriority.b0 = gEntityBelowArray[param_1->spritePriority.b0]; + param_2->spritePriority.b0 = gSpriteSortBelowTable[param_1->spritePriority.b0]; } void sub_0806FB00(Entity* ent, u32 param_1, u32 param_2, u32 param_3) { @@ -474,7 +474,7 @@ u32 sub_0806FCAC(Entity* this, Entity* other) { return sub_0806F5B0(GetFacingDirection(this, other)); } -u32 isEntityWithinDistance(Entity* ent, s32 x, s32 y, s32 distance) { +u32 EntityWithinDistance(Entity* ent, s32 x, s32 y, s32 distance) { return PointInsideRadius(ent->x.HALF.HI - x, ent->y.HALF.HI - y, distance); } @@ -515,7 +515,7 @@ bool32 sub_0806FD54(Entity* this) { if ((gPlayerState.flags & 0x800000) == 0) { rv = 0; } else { - rv = isEntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI - 9, 0x48); + rv = EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI - 9, 0x48); } return rv; @@ -722,5 +722,5 @@ const u8 gUnk_08114F58[] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 0, 0, }; -const u8 gEntityOnTopArray[] = { 0, 0, 1, 2, 3, 4, 5, 6 }; -const u8 gEntityBelowArray[] = { 1, 2, 3, 4, 5, 6, 7, 7 }; +const u8 gSpriteSortAboveTable[] = { 0, 0, 1, 2, 3, 4, 5, 6 }; +const u8 gSpriteSortBelowTable[] = { 1, 2, 3, 4, 5, 6, 7, 7 }; diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c index ae071c63..40338ad7 100644 --- a/src/enemy/acroBandits.c +++ b/src/enemy/acroBandits.c @@ -295,7 +295,7 @@ u32 sub_08031E04(Entity* this) { return 0; tmp = &gUnk_080CE5C0[this->frame & 6]; - return isEntityWithinDistance(this, ent->x.HALF.HI + tmp[0], ent->y.HALF.HI + tmp[1], 0x50); + return EntityWithinDistance(this, ent->x.HALF.HI + tmp[0], ent->y.HALF.HI + tmp[1], 0x50); } void sub_08031E48(Entity* this, Entity* child) { @@ -403,7 +403,7 @@ void sub_08032008(Entity* this) { ProcessMovement(this); } else { if (this->field_0x76.HALF.HI == 0) { - if (isEntityWithinDistance(this, parent->x.HALF.HI, parent->y.HALF.HI, 1) == 0) { + if (EntityWithinDistance(this, parent->x.HALF.HI, parent->y.HALF.HI, 1) == 0) { this->field_0x76.HALF.HI = 1; this->direction = GetFacingDirection(this, parent); sub_080322E8(this); diff --git a/src/enemy/flyingSkull.c b/src/enemy/flyingSkull.c index 28e2e06e..b7ce400a 100644 --- a/src/enemy/flyingSkull.c +++ b/src/enemy/flyingSkull.c @@ -136,7 +136,7 @@ void sub_08039DD8(FlyingSkullEntity* this) { } else { if ((gPlayerState.flags & 0x80) == 0) { Entity* ent = &gPlayerEntity; - if (isEntityWithinDistance(super, ent->x.HALF.HI, ent->y.HALF.HI, 0x30)) { + if (EntityWithinDistance(super, ent->x.HALF.HI, ent->y.HALF.HI, 0x30)) { if (super->type == 1) { super->action = 3; super->actionDelay = 0x1e; diff --git a/src/enemy/gibdo.c b/src/enemy/gibdo.c index 7d1667be..be718aa7 100644 --- a/src/enemy/gibdo.c +++ b/src/enemy/gibdo.c @@ -230,7 +230,7 @@ u32 sub_08037810(Entity* this) { u32 y; if (this->field_0x76.HALF.LO == 0) { if (sub_08049FDC(this, 1) != 0) { - if (isEntityWithinDistance(this, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x40) != 0) { + if (EntityWithinDistance(this, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x40) != 0) { x = GetFacingDirection(this, gUnk_020000B0); if (((x - this->direction + 6) & 0x1f) <= 0xc) { this->action = 3; @@ -257,7 +257,7 @@ u32 sub_080378B0(Entity* this) { if (this->field_0x76.HALF.HI == 0) { if (sub_08049DF4(1) != 0) { if (sub_0804A044(this, gUnk_020000B0, 0xa) == this->direction) - if (isEntityWithinDistance(this, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x18) != 0) { + if (EntityWithinDistance(this, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x18) != 0) { this->action = 5; this->speed = 0x100; InitAnimationForceUpdate(this, this->animationState + 8); @@ -272,13 +272,13 @@ u32 sub_080378B0(Entity* this) { u32 sub_08037914(Entity* this) { if (sub_08049FDC(this, 1) != 0) { - if (isEntityWithinDistance(gUnk_020000B0, this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x28) == 0) { + if (EntityWithinDistance(gUnk_020000B0, this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x28) == 0) { this->field_0x78.HWORD = gUnk_020000B0->x.HALF_U.HI; this->field_0x7a.HWORD = gUnk_020000B0->y.HALF_U.HI; sub_0803797C(this); return 0; } - if (isEntityWithinDistance(this, this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x8) == 0) { + if (EntityWithinDistance(this, this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x8) == 0) { return 0; } this->field_0x76.HALF.LO = 0x3c; diff --git a/src/enemy/gyorgMale.c b/src/enemy/gyorgMale.c index 368d68c6..357af79b 100644 --- a/src/enemy/gyorgMale.c +++ b/src/enemy/gyorgMale.c @@ -279,7 +279,7 @@ void sub_08046B18(GyorgMaleEntity* this) { } void sub_08046B8C(GyorgMaleEntity* this) { - if (isEntityWithinDistance(super, this->unk_80, this->unk_82, 4)) { + if (EntityWithinDistance(super, this->unk_80, this->unk_82, 4)) { super->subAction = 3; this->unk_76 = super->direction << 8; this->unk_80 = gRoomControls.origin_x + 0x200; @@ -309,7 +309,7 @@ void sub_08046C04(GyorgMaleEntity* this) { } void sub_08046C88(GyorgMaleEntity* this) { - if (isEntityWithinDistance(super, this->unk_80, this->unk_82, 4)) { + if (EntityWithinDistance(super, this->unk_80, this->unk_82, 4)) { super->subAction = 1; sub_08048178(this, sub_08048158(this->unk_70)); sub_08047D88(this); @@ -367,7 +367,7 @@ void sub_08046D98(GyorgMaleEntity* this) { } void sub_08046E0C(GyorgMaleEntity* this) { - if (isEntityWithinDistance(super, this->unk_80, this->unk_82, 4)) { + if (EntityWithinDistance(super, this->unk_80, this->unk_82, 4)) { super->subAction = 3; this->unk_76 = super->direction << 8; sub_08047D88(this); @@ -468,7 +468,7 @@ void sub_0804702C(GyorgMaleEntity* this) { } } sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); - if (isEntityWithinDistance(super, this->unk_80, this->unk_82, (super->speed >> 0x10) + 0x10)) { + if (EntityWithinDistance(super, this->unk_80, this->unk_82, (super->speed >> 0x10) + 0x10)) { super->subAction = 2; this->unk_76 = super->direction << 8; super->speed = 0x280; @@ -628,7 +628,7 @@ void sub_080473F0(GyorgMaleEntity* this) { } } sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); - if (isEntityWithinDistance(super, this->unk_80, this->unk_82, 8)) { + if (EntityWithinDistance(super, this->unk_80, this->unk_82, 8)) { super->subAction = 2; this->unk_76 = super->direction << 8; super->speed = 0x180; @@ -796,7 +796,7 @@ void sub_080477F0(GyorgMaleEntity* this) { } super->direction = sub_080045DA(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI); sub_08047E48(this); - if (!isEntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x80)) { + if (!EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x80)) { super->action = 2; super->subAction = 0; super->spriteOrientation.flipY = 2; @@ -804,11 +804,11 @@ void sub_080477F0(GyorgMaleEntity* this) { super->direction = super->animationState; return; } - if (!isEntityWithinDistance(super, gRoomControls.origin_x + 0x200, gRoomControls.origin_y + 0x210, 0x100)) { + if (!EntityWithinDistance(super, gRoomControls.origin_x + 0x200, gRoomControls.origin_y + 0x210, 0x100)) { super->spriteOrientation.flipY = 3; super->spriteRendering.b3 = 3; } - if (isEntityWithinDistance(super, this->unk_80, this->unk_82, 4)) { + if (EntityWithinDistance(super, this->unk_80, this->unk_82, 4)) { super->subAction = 2; this->unk_76 = super->animationState << 8; this->unk_74 = gUnk_080D1BF0[Random() & 1]; @@ -861,7 +861,7 @@ void sub_08047978(GyorgMaleEntity* this) { tmp->parent = super; } } - if (!isEntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x80)) { + if (!EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x80)) { super->action = 2; super->subAction = 0; super->spriteOrientation.flipY = 2; @@ -902,7 +902,7 @@ void sub_08047B08(GyorgMaleEntity* this) { super->direction = sub_080045DA(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI); super->speed = 0x200; sub_08047E58(this); - if (!isEntityWithinDistance(super, this->unk_80, this->unk_82, 4)) + if (!EntityWithinDistance(super, this->unk_80, this->unk_82, 4)) return; if (super->type == 0) { super->action = 7; @@ -1019,7 +1019,7 @@ void sub_08047D88(GyorgMaleEntity* this) { return; if (super->animIndex == 1) return; - if (!isEntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x20)) + if (!EntityWithinDistance(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x20)) return; gPlayerState.field_0x14 = 1; if (gPlayerEntity.z.HALF.HI != 0) @@ -1149,7 +1149,7 @@ void sub_08048004(GyorgMaleEntity* this) { } else { u32 b = super->spriteRendering.b3; if (b != 3) { - if (isEntityWithinDistance(&gPlayerEntity, super->x.HALF.HI, super->y.HALF.HI, 0x24)) { + if (EntityWithinDistance(&gPlayerEntity, super->x.HALF.HI, super->y.HALF.HI, 0x24)) { if (!(this->unk_7c & 2)) { u32 tmp = sub_080045DA(gPlayerEntity.x.HALF.HI - super->x.HALF.HI, gPlayerEntity.y.HALF.HI - super->y.HALF.HI); diff --git a/src/enemy/keese.c b/src/enemy/keese.c index 18ea7e72..1d276078 100644 --- a/src/enemy/keese.c +++ b/src/enemy/keese.c @@ -98,7 +98,7 @@ void Keese_Sleep(Entity* this) { if (this->actionDelay != 0) { this->actionDelay--; } else { - if (isEntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70)) + if (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70)) Keese_StartFly(this); } } @@ -116,7 +116,7 @@ void sub_08021F24(Entity* this) { this->actionDelay = gKeeseRestDurations[Random() & 0xf]; InitializeAnimation(this, KeeseAnimation_Rest); } else if (!this->field_0x7a.HWORD && - !(isEntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70))) { + !(EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70))) { this->action = 3; this->actionDelay = 30; InitializeAnimation(this, KeeseAnimation_Rest); diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c index be2c827a..b7861656 100644 --- a/src/enemy/lakitu.c +++ b/src/enemy/lakitu.c @@ -242,7 +242,7 @@ void Lakitu_Cloudless(Entity* this) { } bool32 sub_0803CA4C(Entity* this) { - if (isEntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x28) == 0) { + if (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x28) == 0) { if (EntityInRectRadius(this, &gPlayerEntity, 0x70, 0x50)) { return 1; } @@ -267,7 +267,7 @@ void sub_0803CA84(Entity* this, u32 unkParameter) { } void sub_0803CAD0(Entity* this) { - if (isEntityWithinDistance(this, this->field_0x74.HWORD, this->field_0x76.HWORD, 1) == 0) { + if (EntityWithinDistance(this, this->field_0x74.HWORD, this->field_0x76.HWORD, 1) == 0) { this->direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, this->field_0x74.HWORD, this->field_0x76.HWORD); @@ -361,7 +361,7 @@ void sub_0803CC08(Entity* this) { return; } - if (!isEntityWithinDistance(this, cloud->x.HALF.HI, cloud->y.HALF.HI, 6)) { + if (!EntityWithinDistance(this, cloud->x.HALF.HI, cloud->y.HALF.HI, 6)) { return; } diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c index 763a529e..80287544 100644 --- a/src/enemy/mazaalBracelet.c +++ b/src/enemy/mazaalBracelet.c @@ -1104,7 +1104,7 @@ u32 sub_0803B4E4(Entity* this) { xoff = this->parent->x.HALF.HI + gUnk_080CFD0A[this->type]; yoff = this->parent->y.HALF.HI + 0x10; - if (isEntityWithinDistance(this, xoff, yoff, 2)) { + if (EntityWithinDistance(this, xoff, yoff, 2)) { this->x.HALF.HI = xoff; this->y.HALF.HI = yoff; return 1; @@ -1164,7 +1164,7 @@ void sub_0803B5C0(Entity* this) { } u32 sub_0803B610(Entity* this) { - return isEntityWithinDistance(this, gPlayerEntity.x.HALF.HI + gUnk_080CFD19[this->type], + return EntityWithinDistance(this, gPlayerEntity.x.HALF.HI + gUnk_080CFD19[this->type], gPlayerEntity.y.HALF.HI - 0xc, 8); } diff --git a/src/enemy/ropeGolden.c b/src/enemy/ropeGolden.c index 54f1ad07..f31229aa 100644 --- a/src/enemy/ropeGolden.c +++ b/src/enemy/ropeGolden.c @@ -63,7 +63,7 @@ void sub_0803827C(Entity* this) { this->field_0xf--; } else { if ((sub_0804A044(this, &gPlayerEntity, 0x8) != 0xff) || - (isEntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x24) != 0)) { + (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x24) != 0)) { sub_080383E4(this); return; } diff --git a/src/enemy/torchTrap.c b/src/enemy/torchTrap.c index a07cd7f3..527a87b7 100644 --- a/src/enemy/torchTrap.c +++ b/src/enemy/torchTrap.c @@ -58,7 +58,7 @@ void sub_0803CF38(TorchTrapEntity* this) { if (sub_0803CFF0(this)) { sub_0803D0B0(this); } else if (sub_08049FDC(super, 0)) { - if (isEntityWithinDistance(super, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x20) == 0) { + if (EntityWithinDistance(super, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x20) == 0) { if (--this->projectileTimer == 0) { TorchTrap_CreateProjectile(this); TorchTrap_Reset(this); diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c index 42b24b13..e0b1a76e 100644 --- a/src/enemy/vaatiArm.c +++ b/src/enemy/vaatiArm.c @@ -671,7 +671,7 @@ void sub_08042EF4(Entity* this) { UpdateAnimationSingleFrame(this); if (sub_08043C98(this) == 0) { if (--this->actionDelay == 0) { - if (isEntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x50)) { + if (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x50)) { this->subAction = 6; this->actionDelay = 0x28; } else { @@ -686,7 +686,7 @@ void sub_08042EF4(Entity* this) { } x = this->parent->x.HALF.HI; y = this->parent->y.HALF.HI - 0x10; - if (isEntityWithinDistance(this, x, y, 0x30)) { + if (EntityWithinDistance(this, x, y, 0x30)) { temp = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, x, y); if ((this->field_0x78.HALF.HI - temp) + 4 < 9) { this->field_0x78.HALF.HI = temp ^ 0x10; diff --git a/src/enemy/vaatiBall.c b/src/enemy/vaatiBall.c index 82dd8948..7b9a57fb 100644 --- a/src/enemy/vaatiBall.c +++ b/src/enemy/vaatiBall.c @@ -170,7 +170,7 @@ void sub_08044868(Entity* this) { break; case 1: LinearMoveUpdate(this); - if (isEntityWithinDistance(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10, 0xc)) { + if (EntityWithinDistance(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10, 0xc)) { this->field_0x74.HALF.LO++; this->x.HALF.HI = vaati->x.HALF.HI; this->y.HALF.HI = vaati->y.HALF.HI - 0x10; @@ -383,7 +383,7 @@ void sub_08044B04(Entity* this) { } } if (this->field_0x78.HALF.HI == 3) - if (isEntityWithinDistance(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10, 0xc)) + if (EntityWithinDistance(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10, 0xc)) vaati->actionDelay++; this->direction = sub_080045B4(this, vaati->x.HALF.HI, vaati->y.HALF.HI - 0x10); return; diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c index bf2ef39c..94732451 100644 --- a/src/enemy/vaatiTransfigured.c +++ b/src/enemy/vaatiTransfigured.c @@ -866,7 +866,7 @@ void sub_080406A0(Entity* this) { uVar6 = gRoomControls.origin_x + gUnk_080D0B58[tmp = uVar5 * 2]; uVar4 = gRoomControls.origin_y + gUnk_080D0B58[tmp + 1]; } - if (isEntityWithinDistance(this, uVar6, uVar4, 0x1c)) { + if (EntityWithinDistance(this, uVar6, uVar4, 0x1c)) { if (uVar5 != 0) { uVar5 = 0; } else { @@ -901,7 +901,7 @@ void sub_08040770(Entity* this) { tmp5 = gRoomControls.origin_x + gUnk_080D0B64[index = tmp2 * 2]; tmp6 = gRoomControls.origin_y + gUnk_080D0B64[index + 1]; } - if (isEntityWithinDistance(this, tmp5, tmp6, 0x1c)) { + if (EntityWithinDistance(this, tmp5, tmp6, 0x1c)) { if (this->animationState != 2) { if (tmp & 8) { tmp2 += 1; diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c index 41df9d76..e8e9ebad 100644 --- a/src/enemy/vaatiWrath.c +++ b/src/enemy/vaatiWrath.c @@ -828,11 +828,11 @@ u32 sub_0804207C(Entity* this) { x = this->x.HALF.HI; y = this->y.HALF.HI - 0x10; arm = ((VaatiWrathHeapStruct*)this->myHeap)->arms[0]; - if ((arm != NULL) && (arm->action >= 5) && isEntityWithinDistance(arm, x, y, 0x30)) { + if ((arm != NULL) && (arm->action >= 5) && EntityWithinDistance(arm, x, y, 0x30)) { return sub_080045D4(arm->x.HALF.HI, arm->y.HALF.HI, x, y); } else { arm = ((VaatiWrathHeapStruct*)this->myHeap)->arms[1]; - if (((arm != NULL) && (arm->action >= 5)) && isEntityWithinDistance(arm, x, y, 0x30)) { + if (((arm != NULL) && (arm->action >= 5)) && EntityWithinDistance(arm, x, y, 0x30)) { return sub_080045D4(arm->x.HALF.HI, arm->y.HALF.HI, x, y); } else { if (gPlayerEntity.y.HALF.HI < 0x40) { diff --git a/src/enemy/wallMaster2.c b/src/enemy/wallMaster2.c index c8e42f45..2efd2c12 100644 --- a/src/enemy/wallMaster2.c +++ b/src/enemy/wallMaster2.c @@ -125,7 +125,7 @@ void sub_0802CE68(Entity* this) { gPlayerState.field_0xa |= 0x80; gPlayerState.mobility |= 0x80; gPlayerState.flags |= PL_DISABLE_ITEMS; - if (!isEntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 4)) { + if (!EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 4)) { this->direction = GetFacingDirection(this, &gPlayerEntity); LinearMoveUpdate(this); } diff --git a/src/manager/managerF.c b/src/manager/managerF.c index eeacda92..b4e7e442 100644 --- a/src/manager/managerF.c +++ b/src/manager/managerF.c @@ -361,7 +361,7 @@ void sub_0805938C(ManagerF* this) { u32 sub_080593CC(ManagerF* this) { if (!(gPlayerState.flags & PL_MINISH) && gPlayerState.swim_state != 0 && gPlayerEntity.animationState == 0 && (gPlayerState.field_0x90 & 0xF00) == 0x400) { - return isEntityWithinDistance(&gPlayerEntity, this->unk_38, this->unk_3a + 0xC, 6); + return EntityWithinDistance(&gPlayerEntity, this->unk_38, this->unk_3a + 0xC, 6); } return 0; } diff --git a/src/npc/npc5.c b/src/npc/npc5.c index 13ac1acf..4ddcc4c5 100644 --- a/src/npc/npc5.c +++ b/src/npc/npc5.c @@ -182,13 +182,13 @@ void sub_08060BA0(Entity* this) { this->speed = 0x1e0; sub_08061120(this, ((UnkHeap*)this->myHeap)->unk_7, ((UnkHeap*)this->myHeap)->unk_8, 0xc); sub_08061170(this); - if (isEntityWithinDistance(this, ((UnkHeap*)this->myHeap)->unk_7, ((UnkHeap*)this->myHeap)->unk_8, 4) != + if (EntityWithinDistance(this, ((UnkHeap*)this->myHeap)->unk_7, ((UnkHeap*)this->myHeap)->unk_8, 4) != 0) { ((UnkHeap*)this->myHeap)->unk_0 &= 0xf7; } } else { if (sub_08060FD0(this, ((UnkHeap*)this->myHeap)->unk_5, ((UnkHeap*)this->myHeap)->unk_6) != 0) { - if (isEntityWithinDistance(this, ((UnkHeap*)this->myHeap)->unk_5, ((UnkHeap*)this->myHeap)->unk_6, 4) != + if (EntityWithinDistance(this, ((UnkHeap*)this->myHeap)->unk_5, ((UnkHeap*)this->myHeap)->unk_6, 4) != 0) { ((UnkHeap*)this->myHeap)->unk_0 &= 0xfb; this->action = 5; @@ -216,7 +216,7 @@ void sub_08060BA0(Entity* this) { this->speed = 0x1e0; sub_08061120(this, ((UnkHeap*)this->myHeap)->unk_7, ((UnkHeap*)this->myHeap)->unk_8, 0xc); sub_08061170(this); - if (isEntityWithinDistance(this, ((UnkHeap*)this->myHeap)->unk_7, ((UnkHeap*)this->myHeap)->unk_8, 4) != + if (EntityWithinDistance(this, ((UnkHeap*)this->myHeap)->unk_7, ((UnkHeap*)this->myHeap)->unk_8, 4) != 0) { ((UnkHeap*)this->myHeap)->unk_0 &= 0xf7; } @@ -230,7 +230,7 @@ void sub_08060BA0(Entity* this) { this->speed = 0x1e0; sub_08061120(this, ((UnkHeap*)this->myHeap)->unk_3, ((UnkHeap*)this->myHeap)->unk_4, 0xc); sub_08061170(this); - if (isEntityWithinDistance(this, ((UnkHeap*)this->myHeap)->unk_3, ((UnkHeap*)this->myHeap)->unk_4, + if (EntityWithinDistance(this, ((UnkHeap*)this->myHeap)->unk_3, ((UnkHeap*)this->myHeap)->unk_4, 4) != 0) { ((UnkHeap*)this->myHeap)->unk_0 &= 0xfd; } diff --git a/src/object/gyorgBossObject.c b/src/object/gyorgBossObject.c index 92ea7fa2..f348b6e6 100644 --- a/src/object/gyorgBossObject.c +++ b/src/object/gyorgBossObject.c @@ -418,7 +418,7 @@ void sub_080A1FF0(GyorgBossObjectEntity* this) { } } if (this->unk_7b) { - if (isEntityWithinDistance(&gPlayerEntity, gRoomControls.origin_x + 0x200, gRoomControls.origin_y + 0x210, + if (EntityWithinDistance(&gPlayerEntity, gRoomControls.origin_x + 0x200, gRoomControls.origin_y + 0x210, 0x100)) { if (super->actionDelay == 0) { super->actionDelay = 0x78; diff --git a/src/object/warpPoint.c b/src/object/warpPoint.c index 27ed883d..02b73a9a 100644 --- a/src/object/warpPoint.c +++ b/src/object/warpPoint.c @@ -192,10 +192,10 @@ void sub_0808B73C(Entity* this) { this->palette.b.b0 = this->parent->palette.b.b0; InitializeAnimation(this, 1); } - if (isEntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x28)) { + if (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x28)) { this->spriteSettings.draw = 1; } else { - if (isEntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x2e)) { + if (EntityWithinDistance(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x2e)) { this->spriteSettings.draw ^= 1; } else { this->spriteSettings.draw = 0; diff --git a/src/projectile/mandiblesProjectile.c b/src/projectile/mandiblesProjectile.c index 4b47889b..257d0f1f 100644 --- a/src/projectile/mandiblesProjectile.c +++ b/src/projectile/mandiblesProjectile.c @@ -303,7 +303,7 @@ NONMATCH("asm/non_matching/mandiblesProjectile/sub_080AA374.inc", bool32 sub_080 // TODO regalloc animationState = this->child->animationState; uVar1 = sub_0806F824(this, this->child, gUnk_08129D14[animationState], gUnk_08129D14[animationState + 1]); - if (isEntityWithinDistance(this, this->child->x.HALF.HI + gUnk_08129D14[animationState], + if (EntityWithinDistance(this, this->child->x.HALF.HI + gUnk_08129D14[animationState], this->child->y.HALF.HI + gUnk_08129D14[animationState + 1], 8) != 0) { result = TRUE; } else {