Clean up a couple of bools

This commit is contained in:
Elliptic Ellipsis 2022-03-25 14:24:18 +00:00
parent dbbf77d76a
commit 29ef1953f0
10 changed files with 27 additions and 29 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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();
}
}

View File

@ -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) {

View File

@ -10,7 +10,6 @@
extern const ScreenTransitionData gUnk_0813ABD0;
extern u32 sub_08079F8C(void);
struct GyorgChildSpawns {
s16 offsetX;
s16 offsetY;

View File

@ -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;

View File

@ -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;