summaryrefslogtreecommitdiff
path: root/src/enemy
diff options
context:
space:
mode:
authornotyourav <65437533+notyourav@users.noreply.github.com>2022-02-11 16:44:33 -0800
committerGitHub <noreply@github.com>2022-02-11 16:44:33 -0800
commitfaaf9c768d8f26f98f605f158c1e412c8d7a8980 (patch)
treef458277ec9bd92c36d8652b7a7e8d12f92dad786 /src/enemy
parent8c964eedd0b632a7936eae0d79d1ab20570015fc (diff)
parentad2b1bc0c3d85cb34b70e1750507a12b462c2ac7 (diff)
Merge pull request #369 from hatal175/boolcast
Diffstat (limited to 'src/enemy')
-rw-r--r--src/enemy/eyegore.c3
-rw-r--r--src/enemy/helmasaur.c7
-rw-r--r--src/enemy/octorokBoss.c2
3 files changed, 7 insertions, 5 deletions
diff --git a/src/enemy/eyegore.c b/src/enemy/eyegore.c
index 4f2d81f8..23acd17f 100644
--- a/src/enemy/eyegore.c
+++ b/src/enemy/eyegore.c
@@ -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,
diff --git a/src/enemy/helmasaur.c b/src/enemy/helmasaur.c
index f0485770..fc90c307 100644
--- a/src/enemy/helmasaur.c
+++ b/src/enemy/helmasaur.c
@@ -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;
}
diff --git a/src/enemy/octorokBoss.c b/src/enemy/octorokBoss.c
index bdbd9144..4af9d5b8 100644
--- a/src/enemy/octorokBoss.c
+++ b/src/enemy/octorokBoss.c
@@ -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;