diff --git a/include/functions.h b/include/functions.h index 59505428..ce06665c 100644 --- a/include/functions.h +++ b/include/functions.h @@ -215,7 +215,7 @@ extern u32 sub_08079B24(void); extern void sub_08079BD8(Entity*); extern u32 sub_08079D48(); extern void sub_08079D84(void); -extern u32 sub_08079F8C(void); +extern bool32 sub_08079F8C(void); extern u32 sub_08079FC4(u32); extern void sub_0807A050(void); extern void sub_0807A5B8(u32); diff --git a/include/object.h b/include/object.h index ef3d2d08..7164e413 100644 --- a/include/object.h +++ b/include/object.h @@ -20,7 +20,7 @@ extern void sub_080787B4(Entity*); extern void sub_0808C650(Entity*, u32); extern u32 sub_0808C67C(void); extern void sub_0808C688(void); -extern void sub_080A2BE4(Entity*, u32); +extern void sub_080A2BE4(Entity*, bool32); void CreateDust(Entity* parent); void CreateDustAt(s32, s32, u32); diff --git a/src/collision.c b/src/collision.c index 52bd8d27..6c4f9a5b 100644 --- a/src/collision.c +++ b/src/collision.c @@ -61,7 +61,7 @@ void CollisionMain(void) { prio = gPriorityHandler.ent_priority; // if any priority is set, dont do collision - if (prio) + if (prio != 0) return; doCollision = &ram_CollideAll; diff --git a/src/enemy/mazaalMacro.c b/src/enemy/mazaalMacro.c index 31de7ed6..21da5f89 100644 --- a/src/enemy/mazaalMacro.c +++ b/src/enemy/mazaalMacro.c @@ -144,7 +144,7 @@ void sub_08034E68(Entity* this) { sub_08035120(this); } if (gRoomTransition.field_0x39 == 0) { - if (sub_08079F8C() != 0) { + if (sub_08079F8C()) { this->action = 3; scriptExecutionContext = StartCutscene(this, (u16*)script_MazaalMacroDefeated); *(ScriptExecutionContext**)&this->cutsceneBeh = scriptExecutionContext; diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c index 2d8c3619..f2c8c769 100644 --- a/src/enemy/vaatiWrath.c +++ b/src/enemy/vaatiWrath.c @@ -561,7 +561,7 @@ void VaatiWrathType0ActionD(Entity* this) { void sub_08041BE8(Entity* this) { Entity* entity; - if (sub_08079F8C() != 0) { + if (sub_08079F8C()) { this->subAction = 1; this->actionDelay = 120; this->updatePriority = PRIO_NO_BLOCK; diff --git a/src/object/book.c b/src/object/book.c index 89005c80..3c9e12b5 100644 --- a/src/object/book.c +++ b/src/object/book.c @@ -40,7 +40,7 @@ void sub_0809B3C4(Entity* this) { } UpdateSpriteForCollisionLayer(this); - InitAnimationForceUpdate(this, this->type + 0x39); + InitAnimationForceUpdate(this, this->type + ITEM_QST_BOOK1); switch (this->type2) { case 0: @@ -88,8 +88,8 @@ void sub_0809B4A8(Entity* this) { this->action = 2; this->actionDelay = 30; - this->speed = 64; - this->direction = 16; + this->speed = 0x40; + this->direction = 0x10; gPlayerState.pushedObject = TREE_THORNS; gPlayerState.queued_action = PLAYER_PUSH; @@ -100,7 +100,7 @@ void sub_0809B4A8(Entity* this) { gPlayerEntity.direction = gPlayerEntity.animationState << 2; EnqueueSFX(SFX_10F); } else { - this->actionDelay = 0x16; + this->actionDelay = 22; } } @@ -108,12 +108,12 @@ void sub_0809B524(Entity* this) { if (--this->actionDelay == 0) { if (--this->field_0xf == 0) { this->action = 3; - this->y.HALF.HI += 32; - this->z.HALF.HI -= 32; + this->y.HALF.HI += 0x20; + this->z.HALF.HI -= 0x20; } else { this->action = 1; this->actionDelay = 22; - this->field_0x80.HALF.LO = 24; + this->field_0x80.HALF.LO = 0x18; } } @@ -142,7 +142,7 @@ void sub_0809B5B4(Entity* this) { if (gPlayerState.flags & PL_MINISH) { sub_0800445C(this); } else if (IsCollidingPlayer(this)) { - CreateItemEntity(this->type + 0x39, 0, 0); + CreateItemEntity(this->type + ITEM_QST_BOOK1, 0, 0); DeleteThisEntity(); } } diff --git a/src/object/floatingPlatform.c b/src/object/floatingPlatform.c index d62d7603..9701ba66 100644 --- a/src/object/floatingPlatform.c +++ b/src/object/floatingPlatform.c @@ -33,12 +33,11 @@ void sub_080860D8(FloatingPlatformEntity* this) { } void sub_0808611C(FloatingPlatformEntity* this) { - int iVar2; + bool32 iVar2 = sub_08086168(this); - iVar2 = sub_08086168(this); if (super->actionDelay != 0 && super->parent->actionDelay == 0) { - if (iVar2 != 0) { + if (iVar2) { super->parent->actionDelay++; } @@ -46,7 +45,7 @@ void sub_0808611C(FloatingPlatformEntity* this) { } else if (super->actionDelay == 0) { sub_080A2BE4(super, iVar2); } else { - sub_080A2BE4(super, 0); + sub_080A2BE4(super, FALSE); } if (--this->unk70 == 0) { diff --git a/src/object/gyorgBossObject.c b/src/object/gyorgBossObject.c index b63b8d81..ebbec424 100644 --- a/src/object/gyorgBossObject.c +++ b/src/object/gyorgBossObject.c @@ -10,7 +10,6 @@ extern const ScreenTransitionData gUnk_0813ABD0; -extern u32 sub_08079F8C(void); struct GyorgChildSpawns { s16 offsetX; s16 offsetY; diff --git a/src/object/lilypadSmall.c b/src/object/lilypadSmall.c index ce03ff99..eed1578f 100644 --- a/src/object/lilypadSmall.c +++ b/src/object/lilypadSmall.c @@ -4,7 +4,7 @@ extern u16 gUnk_08123318[]; static void sub_08097B24(Entity* this); -static u32 sub_08097ADC(Entity* this); +static bool32 sub_08097ADC(Entity* this); void LilypadSmall(Entity* this) { u32 rand; @@ -29,19 +29,19 @@ void LilypadSmall(Entity* this) { } } -static u32 sub_08097ADC(Entity* this) { - if ((gPlayerState.flags & PL_MINISH) == 0) { - return 0; +static bool32 sub_08097ADC(Entity* this) { + if (!(gPlayerState.flags & PL_MINISH)) { + return FALSE; } else if (EntityInRectRadius(this, &gPlayerEntity, 8, 8) == 0) { - return 0; - } else if (sub_08079F8C() == 0) { - return 0; + return FALSE; + } else if (!sub_08079F8C()) { + return FALSE; } else { gPlayerState.field_0x14 = 1; if (gPlayerEntity.z.HALF.HI != 0) { - return 0; + return FALSE; } else { - return 1; + return TRUE; } } } @@ -52,7 +52,7 @@ static void sub_08097B24(Entity* this) { u16* temp3; if (--this->actionDelay == 0) { - this->actionDelay = 0x5a; + this->actionDelay = 90; this->frameIndex = (this->frameIndex + 1) & 3; } temp3 = gUnk_08123318; diff --git a/src/objectUtils.c b/src/objectUtils.c index 6fdbe902..c4a93c17 100644 --- a/src/objectUtils.c +++ b/src/objectUtils.c @@ -264,7 +264,7 @@ void CreateSparkle(Entity* entity) { } } -NONMATCH("asm/non_matching/objectUtils/sub_080A2BE4.inc", void sub_080A2BE4(Entity* this, u32 param_2)) { +NONMATCH("asm/non_matching/objectUtils/sub_080A2BE4.inc", void sub_080A2BE4(Entity* this, bool32 param_2)) { s16 oldValue; s32 diff; u16 newValue;