From 7780c76eac79febc6ad31a77e25637e2372522da Mon Sep 17 00:00:00 2001 From: Elliptic Ellipsis Date: Fri, 18 Mar 2022 23:16:15 +0000 Subject: [PATCH] Correct type of sub_0806F520 and use it as a bool --- include/functions.h | 2 +- src/enemy/chuchu.c | 2 +- src/enemy/enemy50.c | 2 +- src/enemy/ghini.c | 2 +- src/enemy/gyorgChild.c | 2 +- src/enemy/lakituCloud.c | 2 +- src/enemy/rope.c | 2 +- src/enemy/stalfos.c | 2 +- src/enemy/takkuri.c | 2 +- src/enemy/wisp.c | 2 +- src/projectile/lakituCloudProjectile.c | 2 +- src/projectile/spiderWeb.c | 2 +- src/projectile/stalfosProjectile.c | 2 +- src/projectile/v1DarkMagicProjectile.c | 2 +- src/projectile/v2Projectile.c | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/functions.h b/include/functions.h index daa1e0f7..ea3d6ce3 100644 --- a/include/functions.h +++ b/include/functions.h @@ -163,7 +163,7 @@ extern void sub_08060158(Entity*); extern void sub_0806D02C(Entity*); extern void sub_0806D0B0(Entity*); extern void sub_0806F4E8(Entity*); -extern u32 sub_0806F520(); +extern bool32 sub_0806F520(Entity*); extern u32 sub_0806F5B0(u32); extern u32 sub_0806F824(Entity*, Entity*, s32, s32); extern u32 sub_0806F948(Entity*); diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c index 9f23dd3b..34094ef5 100644 --- a/src/enemy/chuchu.c +++ b/src/enemy/chuchu.c @@ -123,7 +123,7 @@ void Chuchu_OnCollision(Entity* this) { } void Chuchu_OnGrabbed(Entity* this) { - if (sub_0806F520(this) == 0 && this->confusedTime) { + if (!sub_0806F520(this) && this->confusedTime) { Create0x68FX(this, FX_STARS); InitializeAnimation(this, 6); } else { diff --git a/src/enemy/enemy50.c b/src/enemy/enemy50.c index 2811e901..40bd1fde 100644 --- a/src/enemy/enemy50.c +++ b/src/enemy/enemy50.c @@ -154,7 +154,7 @@ void sub_08040D30(Enemy50Entity* this) { } void sub_08040D90(Enemy50Entity* this) { - if (sub_0806F520()) { + if (sub_0806F520(super)) { Enemy50_SubActions[super->subAction](this); } else { sub_08041128(this); diff --git a/src/enemy/ghini.c b/src/enemy/ghini.c index 7bd4179b..ab807ba0 100644 --- a/src/enemy/ghini.c +++ b/src/enemy/ghini.c @@ -113,7 +113,7 @@ void Ghini_OnConfused(GhiniEntity* this) { } void Ghini_OnGrabbed(GhiniEntity* this) { - if (sub_0806F520()) { + if (sub_0806F520(super)) { Ghini_SubActions[super->subAction](this); } else { sub_0803F51C(this); diff --git a/src/enemy/gyorgChild.c b/src/enemy/gyorgChild.c index 698ad03a..84bd4e6e 100644 --- a/src/enemy/gyorgChild.c +++ b/src/enemy/gyorgChild.c @@ -56,7 +56,7 @@ void GyorgChild_OnGrabbed(GyorgChildEntity* this) { GyorgChild_OnGrabbed_Action1, GyorgChild_OnGrabbed_Action3, }; - if (sub_0806F520()) { + if (sub_0806F520(super)) { GyorgChild_OnGrabbed_Actions[super->subAction](this); } } diff --git a/src/enemy/lakituCloud.c b/src/enemy/lakituCloud.c index 25616556..1c311f6c 100644 --- a/src/enemy/lakituCloud.c +++ b/src/enemy/lakituCloud.c @@ -34,7 +34,7 @@ void LakituCloud_OnKnockback(Entity* this) { } void LakituCloud_OnGrabbed(Entity* this) { - if (sub_0806F520(this) == 0) { + if (!sub_0806F520(this)) { if (this->subAction == 2) { sub_0803CE3C(this); } diff --git a/src/enemy/rope.c b/src/enemy/rope.c index 8d728a03..61f36bc5 100644 --- a/src/enemy/rope.c +++ b/src/enemy/rope.c @@ -39,7 +39,7 @@ void Rope_OnCollision(Entity* this) { } void Rope_OnGrabbed(Entity* this) { - if (sub_0806F520()) { + if (sub_0806F520(this)) { gUnk_080CE470[this->subAction](this); } } diff --git a/src/enemy/stalfos.c b/src/enemy/stalfos.c index 67f6b6e1..61512e7e 100644 --- a/src/enemy/stalfos.c +++ b/src/enemy/stalfos.c @@ -123,7 +123,7 @@ void sub_08039418(StalfosEntity* this) { } void sub_08039438(StalfosEntity* this) { - if (sub_0806F520()) { + if (sub_0806F520(super)) { Stalfos_SubActions[super->subAction](this); } } diff --git a/src/enemy/takkuri.c b/src/enemy/takkuri.c index dc28b862..a07b8330 100644 --- a/src/enemy/takkuri.c +++ b/src/enemy/takkuri.c @@ -74,7 +74,7 @@ void Takkuri_OnCollision(TakkuriEntity* this) { void Takkuri_OnGrabbed(TakkuriEntity* this) { gUnk_080CFF6C[super->subAction](this); GetNextFrame(super); - if (sub_0806F520(super) == 0) { + if (!sub_0806F520(super)) { super->action = 2; super->subAction = 0; this->unk_0x84 = 2; diff --git a/src/enemy/wisp.c b/src/enemy/wisp.c index 94943d52..213453c2 100644 --- a/src/enemy/wisp.c +++ b/src/enemy/wisp.c @@ -69,7 +69,7 @@ void Wisp_OnCollision(Entity* this) { } void Wisp_OnGrabbed(Entity* this) { - if (sub_0806F520() != 0) { + if (sub_0806F520(this)) { gUnk_080CEB98[this->subAction](this); } } diff --git a/src/projectile/lakituCloudProjectile.c b/src/projectile/lakituCloudProjectile.c index f66dd20e..a766f97b 100644 --- a/src/projectile/lakituCloudProjectile.c +++ b/src/projectile/lakituCloudProjectile.c @@ -24,7 +24,7 @@ void nullsub_539(Entity* this) { } void sub_080A9CF0(Entity* this) { - if (sub_0806F520() == 0) { + if (!sub_0806F520(this)) { CreateFx(this, FX_DEATH, 0); DeleteThisEntity(); } diff --git a/src/projectile/spiderWeb.c b/src/projectile/spiderWeb.c index 93951fad..8f24dae1 100644 --- a/src/projectile/spiderWeb.c +++ b/src/projectile/spiderWeb.c @@ -79,7 +79,7 @@ void sub_080AA78C(Entity* this) { this->subAction = 1; InitAnimationForceUpdate(this, animationState + 8); } - if (sub_0806F520(this) != 0) { + if (sub_0806F520(this)) { UpdateAnimationSingleFrame(this); if ((this->frame & 0x10) != 0) { this->frame &= 0xef; diff --git a/src/projectile/stalfosProjectile.c b/src/projectile/stalfosProjectile.c index 841a68e3..3f8f679d 100644 --- a/src/projectile/stalfosProjectile.c +++ b/src/projectile/stalfosProjectile.c @@ -38,7 +38,7 @@ void sub_080A9A34(Entity* this) { } void sub_080A9A64(Entity* this) { - if ((this->subAction < 3) && (sub_0806F520(this) == 0)) { + if ((this->subAction < 3) && !sub_0806F520(this)) { sub_080A9BA8(this); } StalfosProjectile_SubActions[this->subAction](this); diff --git a/src/projectile/v1DarkMagicProjectile.c b/src/projectile/v1DarkMagicProjectile.c index aeca2aa3..8131c3d7 100644 --- a/src/projectile/v1DarkMagicProjectile.c +++ b/src/projectile/v1DarkMagicProjectile.c @@ -87,7 +87,7 @@ void sub_080AACE0(Entity* this) { } void sub_080AAD70(Entity* this) { - if (sub_0806F520() == 0) { + if (!sub_0806F520(this)) { this->health = 0; } V1DarkMagicProjectile_SubActions[this->subAction](this); diff --git a/src/projectile/v2Projectile.c b/src/projectile/v2Projectile.c index 3733945d..e2c86b53 100644 --- a/src/projectile/v2Projectile.c +++ b/src/projectile/v2Projectile.c @@ -62,7 +62,7 @@ void sub_080ABBF4(Entity* this) { } void sub_080ABC54(Entity* this) { - if (sub_0806F520() == 0) { + if (!sub_0806F520(this)) { CreateFx(this, FX_DEATH, 0); DeleteThisEntity(); }