Remove boolcast uses from code

This commit is contained in:
Tal Hayon
2022-02-10 18:59:54 +02:00
parent 16d8e14488
commit ad2b1bc0c3
22 changed files with 91 additions and 72 deletions
+1 -2
View File
@@ -358,8 +358,7 @@ NONMATCH("asm/non_matching/eyegore/sub_08031024.inc", void sub_08031024(EyegoreE
u32 uVar8;
u32 tmp, tmp2;
u32 res = sub_08049FDC(super, 1);
boolresult = BOOLCAST(res);
boolresult = sub_08049FDC(super, 1) != 0;
if (this->unk_79 == 0) {
if (boolresult != 0) {
super->direction = CalculateDirectionTo(super->x.HALF.HI + super->hitbox->offset_x,
+5 -2
View File
@@ -342,8 +342,11 @@ bool32 sub_0802C0E8(Entity* this) {
Entity* ent = this->collisionLayer == 2 ? &gUnk_0200D654 : &gUnk_02027EB4;
u32 ret = FALSE;
if (!sub_0806FC24(TILE(x, y), 9)) {
u32 tmp = sub_080AE4CC(ent, x, y, 0);
ret = BOOLCAST(tmp);
if (sub_080AE4CC(ent, x, y, 0)) {
ret = 1;
} else {
ret = 0;
}
}
return ret;
}
+1 -1
View File
@@ -805,7 +805,7 @@ void OctorokBoss_Action1_ChargeAttack(Entity* this) {
ProcessMovement(this);
knockbackCondition = 0;
if ((this->direction != 0) && (this->direction != 0x10)) {
knockbackCondition = BOOLCAST((u32)this->collisions & 0xee00);
knockbackCondition = ((u32)this->collisions & 0xee00) != 0;
}
if (((this->direction != 0x18) && (this->direction != 8)) && ((this->collisions & 0xee) != 0)) {
knockbackCondition = 1;