From d78359e9a2604354027ab4214e4f54d863322f23 Mon Sep 17 00:00:00 2001 From: Tal Hayon Date: Sat, 29 Jan 2022 15:34:30 +0200 Subject: [PATCH] Use EntityFlags enum where applicable --- src/code_08077B98.c | 6 ++-- src/enemy/curtain.c | 4 +-- src/enemy/gyorgChild.c | 6 ++-- src/enemy/gyorgFemaleEye.c | 6 ++-- src/enemy/lakitu.c | 2 +- src/enemy/likeLike.c | 2 +- src/enemy/madderpillar.c | 2 +- src/enemy/mazaalBracelet.c | 8 ++--- src/enemy/mazaalHead.c | 4 +-- src/enemy/moldworm.c | 2 +- src/enemy/octorokBoss.c | 6 ++-- src/enemy/pesto.c | 2 +- src/enemy/rupeeLike.c | 2 +- src/enemy/sub_080451CC.c | 2 +- src/enemy/takkuri.c | 2 +- src/enemy/vaatiArm.c | 40 +++++++++++----------- src/enemy/vaatiProjectile.c | 6 ++-- src/enemy/vaatiRebornEnemy.c | 2 +- src/enemy/wallMaster2.c | 2 +- src/enemyUtils.c | 2 +- src/item/itemJarEmpty.c | 6 ++-- src/item/itemOcarina.c | 4 +-- src/item/itemTryPickupObject.c | 2 +- src/npc/beedle.c | 2 +- src/npc/bladeBrothers.c | 2 +- src/npc/brocco.c | 2 +- src/npc/castleMaid.c | 2 +- src/npc/castorWildsStatue.c | 2 +- src/npc/cat.c | 2 +- src/npc/dog.c | 2 +- src/npc/ghostBrothers.c | 2 +- src/npc/gorman.c | 2 +- src/npc/goron.c | 2 +- src/npc/goronMerchant.c | 2 +- src/npc/guard.c | 2 +- src/npc/kid.c | 2 +- src/npc/kingDaltus.c | 2 +- src/npc/malon.c | 2 +- src/npc/melari.c | 2 +- src/npc/ministerPotho.c | 2 +- src/npc/mountainMinish.c | 2 +- src/npc/npc26.c | 2 +- src/npc/npc5.c | 4 +-- src/npc/percy.c | 2 +- src/npc/pina.c | 2 +- src/npc/postman.c | 2 +- src/npc/smith.c | 2 +- src/npc/stamp.c | 2 +- src/npc/sturgeon.c | 2 +- src/npc/talon.c | 2 +- src/npc/tingleSiblings.c | 2 +- src/npc/townMinish.c | 4 +-- src/npc/townsperson.c | 2 +- src/npc/zelda.c | 2 +- src/npcUtils.c | 6 ++-- src/object/hittableLever.c | 2 +- src/object/houseDoorExterior.c | 6 ++-- src/object/lilypadLarge.c | 8 ++--- src/object/warpPoint.c | 2 +- src/playerItem/playerItemC.c | 4 +-- src/playerItem/playerItemLantern.c | 2 +- src/projectile/ballAndChain.c | 4 +-- src/projectile/gyorgMaleEnergyProjectile.c | 2 +- src/projectile/v3ElectricProjectile.c | 2 +- src/projectile/v3TennisBallProjectile.c | 2 +- 65 files changed, 113 insertions(+), 113 deletions(-) diff --git a/src/code_08077B98.c b/src/code_08077B98.c index 7ad3703f..8ea26ce0 100644 --- a/src/code_08077B98.c +++ b/src/code_08077B98.c @@ -26,7 +26,7 @@ void sub_08077BB8(ItemBehavior* beh) { UnkItemStruct* unk = (UnkItemStruct*)beh; // @nocheckin Entity* temp = sub_08077C54(unk); if (temp != NULL) { - temp->flags = 0x20; + temp->flags = ENT_PERSIST; } gPlayerState.item = temp; } @@ -92,7 +92,7 @@ Entity* CreatePlayerItem(u32 subtype, u32 form, u32 parameter, u32 unk) { ent = GetEmptyEntity(); if (ent != NULL) { - ent->flags = 0x80; + ent->flags = ENT_COLLIDE; ent->kind = 8; ent->id = subtype; ent->type = form; @@ -108,7 +108,7 @@ Entity* sub_08077CF8(u32 subtype, u32 form, u32 parameter, u32 unk) { ent = sub_0805E744(); if (ent != NULL) { - ent->flags = 0x80; + ent->flags = ENT_COLLIDE; ent->kind = 8; ent->id = subtype; ent->type = form; diff --git a/src/enemy/curtain.c b/src/enemy/curtain.c index 895a578c..d52c80b3 100644 --- a/src/enemy/curtain.c +++ b/src/enemy/curtain.c @@ -15,7 +15,7 @@ void sub_080481D0(Entity* this) { void sub_080481E8(Entity* this) { if (this->field_0x46) { this->action = 2; - this->flags &= 0x7f; + this->flags &= ~ENT_COLLIDE; this->spritePriority.b0 = 7; this->actionDelay = 3; } else { @@ -36,7 +36,7 @@ void sub_08048224(Entity* this) { this->actionDelay = 0; } else { this->action = 3; - this->flags &= 0x7f; + this->flags &= ~ENT_COLLIDE; this->actionDelay = 1; } diff --git a/src/enemy/gyorgChild.c b/src/enemy/gyorgChild.c index c57e7dce..e260fb25 100644 --- a/src/enemy/gyorgChild.c +++ b/src/enemy/gyorgChild.c @@ -20,7 +20,7 @@ void (*const gUnk_080D1E6C[])(GyorgChildEntity*) = { void GyorgChild(Entity* this) { if (gRoomTransition.field_0x39 == 0) { - this->flags &= ~0x80; + this->flags &= ~ENT_COLLIDE; this->health = 0; this->collisionLayer = 2; } @@ -89,7 +89,7 @@ void sub_080486F4(GyorgChildEntity* this) { s32 r; InitializeAnimation(super, super->animationState); super->action = 1; - super->flags |= 0x80; + super->flags |= ENT_COLLIDE; r = (signed)Random() % 0xB; super->direction += r; super->direction -= 5; @@ -143,7 +143,7 @@ void sub_0804877C(GyorgChildEntity* this) { void sub_0804882C(GyorgChildEntity* this) { if (--super->actionDelay == 0) { super->action = 3; - super->flags |= 0x80; + super->flags |= ENT_COLLIDE; Random(); super->spriteSettings.draw = 1; super->spritePriority.b0 = 4; diff --git a/src/enemy/gyorgFemaleEye.c b/src/enemy/gyorgFemaleEye.c index af10a307..58f74bce 100644 --- a/src/enemy/gyorgFemaleEye.c +++ b/src/enemy/gyorgFemaleEye.c @@ -125,7 +125,7 @@ void sub_08048B84(GyorgFemaleEyeEntity* this) { GetNextFrame(super); if (super->frame & 0x80) { super->action = 3; - super->flags |= 0x80; + super->flags |= ENT_COLLIDE; super->hitType = 0x1E; } } @@ -135,11 +135,11 @@ void sub_08048BB0(GyorgFemaleEyeEntity* this) { if (!((parent->unk_78 >> super->type) & 1)) { if (parent->base.health != 0) { super->action = 4; - super->flags &= ~0x80; + super->flags &= ~ENT_COLLIDE; InitializeAnimation(super, gUnk_080D2030[(super->animationState << 3) + super->type]); } else { super->action = 1; - super->flags &= ~0x80; + super->flags &= ~ENT_COLLIDE; super->spriteSettings.draw = 0; InitializeAnimation(super, gUnk_080D2010[(super->animationState << 3) + super->type]); CreateFx(super, 2, 0x40); diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c index b7861656..bade9999 100644 --- a/src/enemy/lakitu.c +++ b/src/enemy/lakitu.c @@ -326,7 +326,7 @@ void sub_0803CBAC(Entity* this) { cloud = this->child; if (cloud != NULL) { - cloud->flags |= 0x80; + cloud->flags |= ENT_COLLIDE; cloud->hitType = 0x43; } diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c index d65a4c8a..bc6d4f0a 100644 --- a/src/enemy/likeLike.c +++ b/src/enemy/likeLike.c @@ -214,7 +214,7 @@ NONMATCH("asm/non_matching/likeLike/sub_0802810C.inc", void sub_0802810C(Entity* gPlayerState.jump_status = 0x41; gPlayerState.field_0xa = 0; gPlayerState.flags &= 0xffffffef; - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; gPlayerEntity.zVelocity = Q_16_16(1.5); gPlayerEntity.iframes = -60; gPlayerEntity.direction = gPlayerEntity.animationState << 2; diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c index a804035b..be3945ef 100644 --- a/src/enemy/madderpillar.c +++ b/src/enemy/madderpillar.c @@ -471,7 +471,7 @@ void sub_0802A0F8(Entity* this) { } } } else { - this->parent->flags &= ~0x80; + this->parent->flags &= ~ENT_COLLIDE; this->parent->health = 0; this->parent->field_0xf = 0x69; } diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c index 55d40deb..de8e9b7f 100644 --- a/src/enemy/mazaalBracelet.c +++ b/src/enemy/mazaalBracelet.c @@ -605,7 +605,7 @@ void sub_0803AA98(Entity* this) { this->speed = 0x40; InitializeAnimation(this, 10); temp = (*(Entity**)&this->field_0x74); - temp->flags |= 0x80; + temp->flags |= ENT_COLLIDE; temp = this->child; temp->hitType = 0x13; InitAnimationForceUpdate(temp, 5); @@ -754,7 +754,7 @@ void sub_0803ADAC(Entity* this) { if (--this->actionDelay == 0) { this->action = 0x16; this->spriteSettings.draw = 1; - (*(Entity**)&this->field_0x74)->flags |= 0x80; + (*(Entity**)&this->field_0x74)->flags |= ENT_COLLIDE; InitializeAnimation(this, 0xb); InitAnimationForceUpdate(this->child, 6); sub_0803B798(); @@ -1230,7 +1230,7 @@ void sub_0803B798(void) { gPlayerState.jump_status = 0x41; gPlayerState.field_0xa = 0; gPlayerState.flags &= ~(0xffff0000 | PL_CAPTURED); - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; gPlayerEntity.zVelocity = Q_16_16(1.5); gPlayerEntity.z.HALF.HI = -10; gPlayerEntity.direction = 0x10; @@ -1263,7 +1263,7 @@ u32 sub_0803B870(Entity* this) { this->action = 0x18; this->actionDelay = 0x44; this->spriteSettings.draw = 0; - gPlayerEntity.flags = gPlayerEntity.flags & 0x7f; + gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.iframes = -0x10; sub_0803B824(this); entity->hitType = 0x13; diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c index fa44a8d4..55e4923b 100644 --- a/src/enemy/mazaalHead.c +++ b/src/enemy/mazaalHead.c @@ -221,7 +221,7 @@ void sub_08033FFC(Entity* this) { } break; default: - if (((*(Entity**)&this->field_0x74)->flags & 0x80) != 0) { + if (((*(Entity**)&this->field_0x74)->flags & ENT_COLLIDE) != 0) { gRoomControls.camera_target = &gPlayerEntity; sub_08034420(this); gPlayerState.controlMode = 1; @@ -659,7 +659,7 @@ u32 sub_080348A4(Entity* this, Entity* hand_, u32 unk) { break; case 7: hand_->action = 0x1b; - hand_->flags = hand_->flags & 0x7f; + hand_->flags = hand_->flags & ~ENT_COLLIDE; InitializeAnimation(hand_, 5); break; case 8: diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c index 80d1a055..5e2143d6 100644 --- a/src/enemy/moldworm.c +++ b/src/enemy/moldworm.c @@ -85,7 +85,7 @@ void sub_080230E4(Entity* this) { if (this->health == 0 && this->field_0x7c.BYTES.byte3 == 0 && this->action == 7) { CopyPosition(this, &gPlayerEntity); - gPlayerEntity.flags = gPlayerEntity.flags | 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; gPlayerEntity.spriteSettings.draw = 1; gPlayerEntity.zVelocity = Q_16_16(1.5); gPlayerEntity.direction = 0xff; diff --git a/src/enemy/octorokBoss.c b/src/enemy/octorokBoss.c index f603afd8..57c55849 100644 --- a/src/enemy/octorokBoss.c +++ b/src/enemy/octorokBoss.c @@ -832,7 +832,7 @@ void OctorokBoss_Action1_Attack(Entity* this) { if (this->field_0x80.HALF.LO != 0) { gPlayerEntity.spriteSettings.draw = 0; - gPlayerEntity.flags &= 0x7f; + gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.collisionLayer = 2; sub_08078B48(); sub_08077B20(); @@ -972,7 +972,7 @@ void OctorokBoss_ExecuteAttackVacuum(Entity* this) { GET_ANGULAR_VEL(this) = 0x100; GET_HELPER(this)->mouthObject->field_0x78.HALF.HI++; gPlayerEntity.spriteSettings.draw = 1; - gPlayerEntity.flags &= 0x7f; + gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.collisionLayer = 1; sub_080792BC(0x400, (u32)(-(GET_ANGLE_HI(this) + 0x80) * 0x1000000) >> 0x1b, 0x30); OctorokBoss_SetAttackTimer(this); @@ -1112,7 +1112,7 @@ void OctorokBoss_Burning_SubAction2(Entity* this) { void sub_080368D8(Entity* this) { if (this->field_0x80.HALF.LO != 0) { gPlayerEntity.spriteSettings.draw = 1; - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; gPlayerEntity.collisionLayer = 1; } this->field_0x76.HWORD = 0xa0; diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c index b52a69fc..de0cebe5 100644 --- a/src/enemy/pesto.c +++ b/src/enemy/pesto.c @@ -392,7 +392,7 @@ void sub_080244E8(Entity* this) { this->flags2 &= 0xfc; sub_080249DC(this); this->cutsceneBeh.HALF.HI = gPlayerEntity.spritePriority.b1; - gPlayerEntity.flags &= 0x7f; + gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerState.flags |= PL_DISABLE_ITEMS; gPlayerState.field_0xa |= 0x80; if (gPlayerState.swim_state != 0) { diff --git a/src/enemy/rupeeLike.c b/src/enemy/rupeeLike.c index bb8e176f..43bcdd39 100644 --- a/src/enemy/rupeeLike.c +++ b/src/enemy/rupeeLike.c @@ -239,7 +239,7 @@ void sub_080296C8(Entity* this) { void sub_080296D8(Entity* this) { gPlayerState.jump_status = 0x41; gPlayerState.flags &= ~PL_CAPTURED; - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; gPlayerEntity.zVelocity = Q_16_16(1.5); gPlayerEntity.iframes = 0xa6; gPlayerEntity.z.HALF.HI = -2; diff --git a/src/enemy/sub_080451CC.c b/src/enemy/sub_080451CC.c index 14220d47..c7a82990 100644 --- a/src/enemy/sub_080451CC.c +++ b/src/enemy/sub_080451CC.c @@ -3,7 +3,7 @@ void sub_080451CC(Entity* this, Entity* other) { u8* pThis; u8* pOther; - other->flags = this->flags & 0xfe; + other->flags = this->flags & ~ENT_DID_INIT; other->x.WORD = this->x.WORD; other->y.WORD = this->y.WORD; other->z.WORD = this->z.WORD; diff --git a/src/enemy/takkuri.c b/src/enemy/takkuri.c index 7817f0d7..a9a29a9b 100644 --- a/src/enemy/takkuri.c +++ b/src/enemy/takkuri.c @@ -339,7 +339,7 @@ void sub_0803C0AC(Entity* this) { void sub_0803C120(TakkuriEntity* this) { super->action = 5; super->spriteSettings.draw = 0; - super->flags &= 0x7f; + super->flags &= ~ENT_COLLIDE; super->x.HALF.HI = this->x_0x78; super->y.HALF.HI = this->y_0x7a; super->z.HALF.HI += 8; diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c index e0b1a76e..33dc556f 100644 --- a/src/enemy/vaatiArm.c +++ b/src/enemy/vaatiArm.c @@ -269,15 +269,15 @@ void sub_08042654(Entity* this) { break; this->subAction = 5; this->actionDelay = 0x5a; - ((VaatiArm_HeapStruct*)this->myHeap)->entities[0]->flags |= 0x80; + ((VaatiArm_HeapStruct*)this->myHeap)->entities[0]->flags |= ENT_COLLIDE; ((VaatiArm_HeapStruct*)this->myHeap)->entities[0]->spritePriority.b0 = 4; - ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->flags |= 0x80; + ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->flags |= ENT_COLLIDE; ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->spritePriority.b0 = 4; - ((VaatiArm_HeapStruct*)this->myHeap)->entities[2]->flags |= 0x80; + ((VaatiArm_HeapStruct*)this->myHeap)->entities[2]->flags |= ENT_COLLIDE; ((VaatiArm_HeapStruct*)this->myHeap)->entities[2]->spritePriority.b0 = 4; - ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]->flags |= 0x80; + ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]->flags |= ENT_COLLIDE; ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]->spritePriority.b0 = 4; - ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->flags |= 0x80; + ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->flags |= ENT_COLLIDE; ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->spritePriority.b0 = 4; InitAnimationForceUpdate(this, 7); SoundReq(SFX_15E); @@ -495,7 +495,7 @@ void sub_08042B20(Entity* this) { CopyPosition(((VaatiArm_HeapStruct*)this->myHeap)->entities[4], object); } } - entity->flags &= 0x7f; + entity->flags &= ~ENT_COLLIDE; entity->spriteSettings.draw = 0; SoundReq(SFX_161); } @@ -599,7 +599,7 @@ void sub_08042D6C(Entity* this) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; if (entity->z.HALF.HI < 4) { if (i != 2) { - entity->flags = entity->flags | 0x80; + entity->flags = entity->flags | ENT_COLLIDE; } if ((entity->spriteSettings.draw == 0u) && (object = CreateObject(OBJECT_AF, 2, 0), object != NULL)) { CopyPosition(entity, object); @@ -803,7 +803,7 @@ void sub_08043130(Entity* this) { for (i = 0; i < 4; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; if (entity->z.HALF.HI > -4) { - entity->flags = entity->flags & 0x7f; + entity->flags = entity->flags & ~ENT_COLLIDE; if (entity->spriteSettings.draw == 1) { SoundReq(SFX_161); } @@ -872,7 +872,7 @@ NONMATCH("asm/non_matching/vaati/sub_0804334C.inc", void sub_0804334C(Entity* th } for (i = 0; i < 5; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; - entity->flags = entity->flags | 0x80; + entity->flags = entity->flags | ENT_COLLIDE; entity->spriteSettings.draw = 1; } } @@ -958,15 +958,15 @@ void sub_08043490(Entity* this) { } else { entity->z.HALF.HI -= 2; if (entity->z.HALF.HI < 0) { - entity->flags = entity->flags | 0x80; + entity->flags = entity->flags | ENT_COLLIDE; entity->spriteSettings.draw = 1; entity->field_0x3c = entity->field_0x3c & 0xef; entity->hitType = 0x3a; entity->hitbox = (Hitbox*)&gUnk_080FD450; entity2 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[2]; - entity2->flags = entity2->flags | 0x80; + entity2->flags = entity2->flags | ENT_COLLIDE; entity3 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]; - entity3->flags = entity3->flags & 0x7f; + entity3->flags = entity3->flags & ~ENT_COLLIDE; } } UpdateAnimationSingleFrame(this); @@ -1000,7 +1000,7 @@ void sub_08043580(Entity* this) { for (i = 0; i < 5; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; if (-4 < entity->z.HALF.HI) { - entity->flags = entity->flags & 0x7f; + entity->flags = entity->flags & ~ENT_COLLIDE; entity->spriteSettings.draw = 0; } } @@ -1052,7 +1052,7 @@ void sub_08043698(Entity* this) { this->actionDelay = 0x3c; for (i = 0; i < 5; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; - entity->flags = entity->flags & 0x7f; + entity->flags = entity->flags & ~ENT_COLLIDE; } } @@ -1325,7 +1325,7 @@ void sub_08043D08(Entity* this) { this->subAction = 0; InitAnimationForceUpdate(this, 0xd); entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; - entity->flags &= 0x7f; + entity->flags &= ~ENT_COLLIDE; entity->spriteSettings.draw = 0; InitializeAnimation(entity, 0x13); sub_0804AA1C(entity); @@ -1392,17 +1392,17 @@ void sub_08043EB8(Entity* this) { this->spritePriority.b0 = 4; InitAnimationForceUpdate(this, 0xd); pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]; - pEVar4->flags = pEVar4->flags | 0x80; + pEVar4->flags = pEVar4->flags | ENT_COLLIDE; pEVar4->spritePriority.b0 = 4; pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[2]; - pEVar4->flags = pEVar4->flags | 0x80; + pEVar4->flags = pEVar4->flags | ENT_COLLIDE; pEVar4->spritePriority.b0 = 4; pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]; - pEVar4->flags = pEVar4->flags & 0x7f; + pEVar4->flags = pEVar4->flags & ~ENT_COLLIDE; pEVar4->spriteSettings.draw = 1; pEVar4->spritePriority.b0 = 4; pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; - pEVar4->flags = pEVar4->flags | 0x80; + pEVar4->flags = pEVar4->flags | ENT_COLLIDE; pEVar4->spriteSettings.draw = 1; pEVar4->spritePriority.b0 = 4; pEVar4->x.HALF.HI = (this->type2 == 0) ? gRoomTransition.field_0x44 : gRoomTransition.field_0x48; @@ -1432,7 +1432,7 @@ NONMATCH("asm/non_matching/vaati/sub_08044000.inc", void sub_08044000(Entity* th ptr2 = &gUnk_080D1400[this->type2 * 5]; for (i = 0; i < 5; ptr2++, i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; - entity->flags = entity->flags | 0x80; + entity->flags = entity->flags | ENT_COLLIDE; entity->spritePriority.b0 = 4; ptr = &((VaatiArm_HeapStruct*)this->myHeap)->s1[i]; ptr->unk00.HWORD = *ptr2; diff --git a/src/enemy/vaatiProjectile.c b/src/enemy/vaatiProjectile.c index 39e68307..440a4287 100644 --- a/src/enemy/vaatiProjectile.c +++ b/src/enemy/vaatiProjectile.c @@ -65,7 +65,7 @@ void VaatiProjectileFunction1(Entity* this) { this->action = 5; COLLISION_OFF(this); this->spritePriority.b1 = 0; - gPlayerEntity.flags &= 0x7f; + gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.spriteOrientation.flipY = this->spriteOrientation.flipY; gPlayerEntity.spriteRendering.b3 = this->spriteRendering.b3; sub_0803E444(this); @@ -73,12 +73,12 @@ void VaatiProjectileFunction1(Entity* this) { SetPlayerControl(2); entity = this->parent; if (entity != NULL) { - entity->flags = entity->flags & 0x7f; + entity->flags = entity->flags & ~ENT_COLLIDE; } } else { gPlayerState.flags &= ~PL_DISABLE_ITEMS; entity = &gPlayerEntity; - entity->flags = gPlayerEntity.flags | 0x80; + entity->flags = gPlayerEntity.flags | ENT_COLLIDE; } #endif } diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c index 99f1777b..0d625249 100644 --- a/src/enemy/vaatiRebornEnemy.c +++ b/src/enemy/vaatiRebornEnemy.c @@ -654,7 +654,7 @@ void VaatiRebornEnemyType1PreAction(Entity* this) { if (2 < ++parent->field_0x86.HALF.LO) { COLLISION_OFF(this); parent->action = 7; - parent->flags &= 0x7f; + parent->flags &= ~ENT_COLLIDE; parent->actionDelay = 0x80; parent->spriteOffsetX = 0; parent->direction = -1; diff --git a/src/enemy/wallMaster2.c b/src/enemy/wallMaster2.c index 2efd2c12..b2d5ba9f 100644 --- a/src/enemy/wallMaster2.c +++ b/src/enemy/wallMaster2.c @@ -41,7 +41,7 @@ void sub_0802CC80(Entity* this) { this->action = 3; COLLISION_OFF(this); InitializeAnimation(this, 1); - gPlayerEntity.flags &= ~0x80; + gPlayerEntity.flags &= ~ENT_COLLIDE; break; } if (this->field_0x43 != 0) { diff --git a/src/enemyUtils.c b/src/enemyUtils.c index 956ba639..0e0929e6 100644 --- a/src/enemyUtils.c +++ b/src/enemyUtils.c @@ -54,7 +54,7 @@ bool32 EnemyInit(Entity* this) { object->spritePriority.b0 = 3; object->parent = this; CopyPosition(this, object); - this->flags &= 0x7f; + this->flags &= ~ENT_COLLIDE; this->spriteSettings.draw = 0; this->field_0x6c.HALF.HI |= 0x10; } diff --git a/src/item/itemJarEmpty.c b/src/item/itemJarEmpty.c index 4fcf4668..11a27fcc 100644 --- a/src/item/itemJarEmpty.c +++ b/src/item/itemJarEmpty.c @@ -46,7 +46,7 @@ void sub_08077534(ItemBehavior* this, u32 arg1) { sub_08077DF4(this, 0x610); break; } - gPlayerEntity.flags &= 0x7f; + gPlayerEntity.flags &= ~ENT_COLLIDE; } void sub_08077618(ItemBehavior* this, u32 arg1) { @@ -61,7 +61,7 @@ void sub_08077618(ItemBehavior* this, u32 arg1) { void sub_08077640(ItemBehavior* this, u32 arg1) { UpdateItemAnim(this); if ((this->field_0x5[9] & 0x80) != 0) { - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; sub_08077E78(this, arg1); } } @@ -69,7 +69,7 @@ void sub_08077640(ItemBehavior* this, u32 arg1) { void sub_0807766C(ItemBehavior* this, u32 arg1) { UpdateItemAnim(this); if ((this->field_0x5[9] & 0x80) != 0) { - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; sub_08077E78(this, arg1); } } diff --git a/src/item/itemOcarina.c b/src/item/itemOcarina.c index 5913c477..af8812bb 100644 --- a/src/item/itemOcarina.c +++ b/src/item/itemOcarina.c @@ -20,7 +20,7 @@ void OcarinaUse(ItemBehavior* this, u32 arg1) { this->field_0x5[4] |= 0xf; gPlayerEntity.animationState = 0x04; gPlayerEntity.spriteSettings.flipX = 0; - gPlayerEntity.flags &= 0x7f; + gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.field_0x7a.HWORD = 2; gPlayerState.flags |= PL_USE_OCARINA; gPlayerState.field_0x27[0] = -1; @@ -38,7 +38,7 @@ NONMATCH("asm/non_matching/ocarina/OcarinaUpdate.inc", void OcarinaUpdate(ItemBe // TODO regalloc UpdateItemAnim(this); if ((this->field_0x5[9] & 0x80) != 0) { - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; gPlayerState.flags &= ~PL_USE_OCARINA; gPlayerState.field_0x27[0] = 0; gUnk_02034490[0] = 0; diff --git a/src/item/itemTryPickupObject.c b/src/item/itemTryPickupObject.c index 3e161d89..1eb0c3e2 100644 --- a/src/item/itemTryPickupObject.c +++ b/src/item/itemTryPickupObject.c @@ -30,7 +30,7 @@ void sub_08076488(ItemBehavior* this, u32 arg1) { } UpdateItemAnim(this); if ((this->field_0x5[9] & 0x80) != 0) { - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; gPlayerState.heldObject = 4; bVar1 = ~(8 >> arg1); gPlayerState.keepFacing = bVar1 & gPlayerState.keepFacing; diff --git a/src/npc/beedle.c b/src/npc/beedle.c index 703773ff..9a9717ab 100644 --- a/src/npc/beedle.c +++ b/src/npc/beedle.c @@ -26,7 +26,7 @@ s32 sub_080633C8(Entity* this); void sub_0806346C(Entity* this); void Beedle(Entity* this) { - if (this->flags & 0x2) { + if (this->flags & ENT_SCRIPTED) { sub_08063410(this); } else { sub_080632C8(this); diff --git a/src/npc/bladeBrothers.c b/src/npc/bladeBrothers.c index 5d2ddca1..63bc4310 100644 --- a/src/npc/bladeBrothers.c +++ b/src/npc/bladeBrothers.c @@ -35,7 +35,7 @@ extern EntityData gUnk_080F3494; static void sub_08068BEC(Entity* this, u32 unused); void BladeBrothers(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { gUnk_081115D0[this->action](this); } else { gUnk_081115C0[this->action](this); diff --git a/src/npc/brocco.c b/src/npc/brocco.c index b960237c..0030dd0f 100644 --- a/src/npc/brocco.c +++ b/src/npc/brocco.c @@ -11,7 +11,7 @@ extern void (*gUnk_0810CAA0[])(Entity*); extern Dialog gUnk_0810CAAC[]; void Brocco(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_0806362C(this); } else { sub_08063544(this); diff --git a/src/npc/castleMaid.c b/src/npc/castleMaid.c index 3322656f..154d1b0c 100644 --- a/src/npc/castleMaid.c +++ b/src/npc/castleMaid.c @@ -17,7 +17,7 @@ extern SpriteLoadData gUnk_0810F874[]; extern u32 _call_via_r0(u32*); void Maid(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_08064570(this); } else { DeleteThisEntity(); diff --git a/src/npc/castorWildsStatue.c b/src/npc/castorWildsStatue.c index 2c388a08..e950d54b 100644 --- a/src/npc/castorWildsStatue.c +++ b/src/npc/castorWildsStatue.c @@ -23,7 +23,7 @@ extern PosOffset gUnk_08110E78[]; extern PosOffset gUnk_08110E8A[]; void CastorWildsStatue(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { gUnk_08110E5C[this->action](this); } else { gUnk_08110E4C[this->action](this); diff --git a/src/npc/cat.c b/src/npc/cat.c index 4d236eb6..a5cba705 100644 --- a/src/npc/cat.c +++ b/src/npc/cat.c @@ -48,7 +48,7 @@ void sub_08067790(Entity* this) { void Cat(Entity* ent) { gCat[ent->action](ent); sub_08067C44(ent); - if (((ent->flags & 128) == 0) && (ent->type != 5)) { + if (((ent->flags & ENT_COLLIDE) == 0) && (ent->type != 5)) { sub_0806ED78(ent); } } diff --git a/src/npc/dog.c b/src/npc/dog.c index 85ed9568..111b27e0 100644 --- a/src/npc/dog.c +++ b/src/npc/dog.c @@ -62,7 +62,7 @@ void sub_08069B44(Entity* this) { this->field_0x74.HALF.LO = sub_0801E99C(this); SetDefaultPriority(this, PRIO_MESSAGE); InitAnimationForceUpdate(this, 10); - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_0807DD50(this); } if (((this->type == 0) && ((gPlayerState.flags & PL_MINISH) == 0)) && (GetInventoryValue(0x36) != 2)) { diff --git a/src/npc/ghostBrothers.c b/src/npc/ghostBrothers.c index 1093a14d..466b5285 100644 --- a/src/npc/ghostBrothers.c +++ b/src/npc/ghostBrothers.c @@ -23,7 +23,7 @@ void sub_08065C0C(Entity* this); static EntityAction* const gUnk_08110164[]; void GhostBrothers(Entity* this) { - if (this->flags & 0x2) { + if (this->flags & ENT_SCRIPTED) { sub_08065C0C(this); } else { gUnk_08110164[this->type](this); diff --git a/src/npc/gorman.c b/src/npc/gorman.c index 7dfaf6ca..af735017 100644 --- a/src/npc/gorman.c +++ b/src/npc/gorman.c @@ -21,7 +21,7 @@ void sub_08069888(Entity* this); extern u16 gUnk_08111C50[]; void Gorman(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_08069838(this); } else { sub_080697A4(this); diff --git a/src/npc/goron.c b/src/npc/goron.c index baada241..ab17ce82 100644 --- a/src/npc/goron.c +++ b/src/npc/goron.c @@ -10,7 +10,7 @@ extern void (*gUnk_08111A8C[])(Entity*); extern Dialog gUnk_08111A94[]; void Goron(Entity* this) { - if (this->flags & 2) { + if (this->flags & ENT_SCRIPTED) { gUnk_08111A8C[this->action](this); } else { gUnk_08111A80[this->action](this); diff --git a/src/npc/goronMerchant.c b/src/npc/goronMerchant.c index df239bd4..8862610f 100644 --- a/src/npc/goronMerchant.c +++ b/src/npc/goronMerchant.c @@ -16,7 +16,7 @@ static const u16 sKinstonePrices[]; extern u32 sub_0801E7D0(u32); void GoronMerchant(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { gUnk_08111B98[this->action](this); } else { gUnk_08111B88[this->action](this); diff --git a/src/npc/guard.c b/src/npc/guard.c index d8afe8b2..9c36c7f9 100644 --- a/src/npc/guard.c +++ b/src/npc/guard.c @@ -32,7 +32,7 @@ extern SpriteLoadData gUnk_0810F524[]; extern void* gUnk_0810F6BC[]; void Guard(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { gUnk_0810F544[this->action](this); } else { sub_08063D24(this); diff --git a/src/npc/kid.c b/src/npc/kid.c index 02910850..011327db 100644 --- a/src/npc/kid.c +++ b/src/npc/kid.c @@ -27,7 +27,7 @@ extern Dialog gUnk_0810BE10[]; extern u8 gUnk_0810C0A0[]; void Kid(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_080621AC(this); } else { gUnk_0810BE0C[this->action](this); diff --git a/src/npc/kingDaltus.c b/src/npc/kingDaltus.c index e159c531..5fa29df2 100644 --- a/src/npc/kingDaltus.c +++ b/src/npc/kingDaltus.c @@ -9,7 +9,7 @@ extern void (*const gUnk_081104E0[])(Entity*); extern void (*const gUnk_081104EC[])(Entity*); void KingDaltus(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { if (this->interactType == 2) { this->interactType = 0; this->action = 2; diff --git a/src/npc/malon.c b/src/npc/malon.c index cff3828f..77d6a20c 100644 --- a/src/npc/malon.c +++ b/src/npc/malon.c @@ -7,7 +7,7 @@ extern void (*gUnk_0810FF5C[])(Entity* this); extern void (*gUnk_0810FF64[])(Entity* this); void Malon(Entity* this) { - if (this->flags & 0x2) { + if (this->flags & ENT_SCRIPTED) { gUnk_0810FF64[this->action](this); } else { gUnk_0810FF5C[this->action](this); diff --git a/src/npc/melari.c b/src/npc/melari.c index 7b28d0e2..4bdae9d3 100644 --- a/src/npc/melari.c +++ b/src/npc/melari.c @@ -10,7 +10,7 @@ extern u16 gUnk_0811153E[]; extern u16 gUnk_08111538[]; void Melari(Entity* this) { - if ((this->flags & 2) == 0) { + if ((this->flags & ENT_SCRIPTED) == 0) { gUnk_08111530[this->action](this); sub_0806ED78(this); } else { diff --git a/src/npc/ministerPotho.c b/src/npc/ministerPotho.c index 70e012eb..e86bca42 100644 --- a/src/npc/ministerPotho.c +++ b/src/npc/ministerPotho.c @@ -9,7 +9,7 @@ void sub_08066864(Entity*); extern u16 gUnk_08110650[]; void MinisterPotho(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_08066864(this); } else { gUnk_08110644[this->action](this); diff --git a/src/npc/mountainMinish.c b/src/npc/mountainMinish.c index ed76f1e1..90a370db 100644 --- a/src/npc/mountainMinish.c +++ b/src/npc/mountainMinish.c @@ -13,7 +13,7 @@ void sub_08067EF0(Entity*); extern u16 gUnk_0811130E[]; void MountainMinish(Entity* this) { - if ((this->flags & 2) == 0) { + if ((this->flags & ENT_SCRIPTED) == 0) { gUnk_08111368[this->action](this); sub_0806ED78(this); } else { diff --git a/src/npc/npc26.c b/src/npc/npc26.c index 3a4fbf75..3603d246 100644 --- a/src/npc/npc26.c +++ b/src/npc/npc26.c @@ -6,7 +6,7 @@ static void (*const gUnk_081106D4[])(Entity*); static void (*const gUnk_081106E0[])(Entity*); void NPC26(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { gUnk_081106E0[this->action](this); } else { gUnk_081106D4[this->action](this); diff --git a/src/npc/npc5.c b/src/npc/npc5.c index ad5b98f2..3305d1a3 100644 --- a/src/npc/npc5.c +++ b/src/npc/npc5.c @@ -85,7 +85,7 @@ void CreateZeldaFollower(void) { npc = CreateNPC(0x2e, 0, 0); if (npc != NULL) { CopyPosition(&gPlayerEntity, npc); - npc->flags |= 0x20; + npc->flags |= ENT_PERSIST; npc->animationState = GetAnimationState(npc); } } @@ -820,7 +820,7 @@ void sub_08061AA8(Entity* this) { } void sub_08061ACC(Entity* this) { - this->flags = this->flags | 0x20; + this->flags = this->flags | ENT_PERSIST; this->action = 1; this->subAction = 0xff; this->actionDelay = 0; diff --git a/src/npc/percy.c b/src/npc/percy.c index db53c99d..b8defea1 100644 --- a/src/npc/percy.c +++ b/src/npc/percy.c @@ -21,7 +21,7 @@ void Percy_Head(Entity* this) { } void Percy(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_0806B41C(this); } else { sub_0806B3CC(this); diff --git a/src/npc/pina.c b/src/npc/pina.c index 1ca1e56e..703a8061 100644 --- a/src/npc/pina.c +++ b/src/npc/pina.c @@ -13,7 +13,7 @@ extern void (*gUnk_0810CDF8[])(Entity*); extern Dialog gUnk_0810CE04[]; void Pina(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_08063B68(this); } else { sub_08063A80(this); diff --git a/src/npc/postman.c b/src/npc/postman.c index 3629950c..63c6fcf1 100644 --- a/src/npc/postman.c +++ b/src/npc/postman.c @@ -21,7 +21,7 @@ extern void (*const gUnk_0810AA24[])(Entity*); extern Dialog gUnk_0810AA30[]; void Postman(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_08060528(this); } else { gUnk_0810AA24[this->action](this); diff --git a/src/npc/smith.c b/src/npc/smith.c index 764a2aa8..9667b16c 100644 --- a/src/npc/smith.c +++ b/src/npc/smith.c @@ -14,7 +14,7 @@ extern u32 gUnk_081103E0; void Smith(Entity* this) { u32 index; - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { if (this->interactType == 2) { this->action = 4; this->interactType = 0; diff --git a/src/npc/stamp.c b/src/npc/stamp.c index 4fd6944b..2390a2a9 100644 --- a/src/npc/stamp.c +++ b/src/npc/stamp.c @@ -13,7 +13,7 @@ extern void (*gStampBehaviors2[2])(Entity*); extern Dialog gUnk_0810C2E4[2]; void Stamp(Entity* ent) { - if ((ent->flags & 2) != 0) { + if ((ent->flags & ENT_SCRIPTED) != 0) { gStampBehaviors2[ent->action](ent); } else { gStampBehaviors1[ent->action](ent); diff --git a/src/npc/sturgeon.c b/src/npc/sturgeon.c index 5961a0e1..60f77c1c 100644 --- a/src/npc/sturgeon.c +++ b/src/npc/sturgeon.c @@ -14,7 +14,7 @@ extern void (*const gUnk_0810FA44[])(Entity*); void sub_08064C9C(Entity* this); void Sturgeon(Entity* this) { - if ((this->flags & 2) == 0) { + if ((this->flags & ENT_SCRIPTED) == 0) { gUnk_0810FA44[this->action](this); sub_0806ED78(this); } else { diff --git a/src/npc/talon.c b/src/npc/talon.c index d991ab1f..075e4df4 100644 --- a/src/npc/talon.c +++ b/src/npc/talon.c @@ -10,7 +10,7 @@ extern u8 gUnk_0810FED8[]; void sub_0806574C(Entity* this); void Talon(Entity* this) { - if (this->flags & 2) { + if (this->flags & ENT_SCRIPTED) { gUnk_0810FEC4[this->action](this); } else { gUnk_0810FEBC[this->action](this); diff --git a/src/npc/tingleSiblings.c b/src/npc/tingleSiblings.c index 490f15ee..48c46b6c 100644 --- a/src/npc/tingleSiblings.c +++ b/src/npc/tingleSiblings.c @@ -10,7 +10,7 @@ extern void sub_08064EE8(Entity*); extern void (*const gUnk_0810FBFC[])(Entity*); void TingleSiblings(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_08064DE4(this); } else { sub_08064D78(this); diff --git a/src/npc/townMinish.c b/src/npc/townMinish.c index 04638c22..96bc355e 100644 --- a/src/npc/townMinish.c +++ b/src/npc/townMinish.c @@ -24,7 +24,7 @@ extern u16 gUnk_08112C5C[2]; extern u16 gUnk_08112C60[4]; void TownMinish(Entity* this) { - if ((this->flags & 2) == 0) { + if ((this->flags & ENT_SCRIPTED) == 0) { gUnk_081126E8[this->action](this); sub_0806ED78(this); } else { @@ -139,7 +139,7 @@ void sub_0806ADFC(Entity* this) { void TownMinish_Head(Entity* this) { u32 frames; - if ((this->flags & 2) == 0) { + if ((this->flags & ENT_SCRIPTED) == 0) { frames = this->field_0x68.HALF.HI / 2; if ((this->frameSpriteSettings & 1)) { SetExtraSpriteFrame(this, 0, frames + 0x1c); diff --git a/src/npc/townsperson.c b/src/npc/townsperson.c index edb1b694..8cfd33c1 100644 --- a/src/npc/townsperson.c +++ b/src/npc/townsperson.c @@ -26,7 +26,7 @@ extern u16 gUnk_0810B7BA[]; extern Dialog gUnk_0810B7C0[]; void Townsperson(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { gUnk_0810B77C[this->action](this); } else { gUnk_0810B774[this->action](this); diff --git a/src/npc/zelda.c b/src/npc/zelda.c index f0bc5b77..4842ec83 100644 --- a/src/npc/zelda.c +++ b/src/npc/zelda.c @@ -73,7 +73,7 @@ void sub_08066D94(Entity* this) { npc = CreateNPC(0x2E, 0, 0); if (npc != NULL) { npc->animationState = gPlayerEntity.animationState; - npc->flags |= 0x20; + npc->flags |= ENT_PERSIST; npc->animationState = GetAnimationState(this); room = gRoomControls.room; npc->field_0x74.HWORD = room; diff --git a/src/npcUtils.c b/src/npcUtils.c index 5ae5f547..9eff64f5 100644 --- a/src/npcUtils.c +++ b/src/npcUtils.c @@ -56,7 +56,7 @@ void NPCInit(Entity* this) { const NPCDefinition* definition = GetNPCDefinition(this); if (definition->bitfield.type == 0) { // No sprite for this NPC - this->flags |= 1; + this->flags |= ENT_DID_INIT; } else { tmp = definition->bitfield.gfx; switch (definition->bitfield.gfx_type) { @@ -290,13 +290,13 @@ void sub_0806F0A4(void) { for (currentEntity = entityList->first; currentEntity != (Entity*)entityList; currentEntity = currentEntity->next) { Entity* nextEnt; - if ((currentEntity->flags & 1) == 0) + if ((currentEntity->flags & ENT_DID_INIT) == 0) continue; if ((currentEntity->field_0x17 & 1) == 0) continue; for (nextEnt = currentEntity->next; nextEnt != (Entity*)entityList; nextEnt = nextEnt->next) { - if ((nextEnt->flags & 1) == 0) + if ((nextEnt->flags & ENT_DID_INIT) == 0) continue; if ((nextEnt->field_0x17 & 1) == 0) continue; diff --git a/src/object/hittableLever.c b/src/object/hittableLever.c index 6dc52e8d..401e9671 100644 --- a/src/object/hittableLever.c +++ b/src/object/hittableLever.c @@ -32,7 +32,7 @@ void HittableLever(HittableLeverEntity* this) { void HittableLever_Init(HittableLeverEntity* this) { super->action = 1; - super->flags |= 0x80; + super->flags |= ENT_COLLIDE; super->field_0x3c = 7; super->hitType = 0x8f; super->flags2 = 0xa; diff --git a/src/object/houseDoorExterior.c b/src/object/houseDoorExterior.c index a1495848..92ba70b8 100644 --- a/src/object/houseDoorExterior.c +++ b/src/object/houseDoorExterior.c @@ -105,7 +105,7 @@ void sub_0808681C(Entity* this) { this->action = 2; this->frameIndex = 1; } - if (this->flags & 0x2) { + if (this->flags & ENT_SCRIPTED) { this->action = 2; } break; @@ -119,7 +119,7 @@ void sub_0808681C(Entity* this) { break; } - if (this->flags & 0x2) { + if (this->flags & ENT_SCRIPTED) { ExecuteScript(this, *(ScriptExecutionContext**)&this->cutsceneBeh); sub_080868EC(this, *(void**)&this->cutsceneBeh); } @@ -158,7 +158,7 @@ static void sub_080868EC(Entity* entity, unk_80868EC* arg1) { } void sub_0808692C(Entity* this) { - this->flags &= 0xFD; + this->flags &= ~ENT_SCRIPTED; this->type2 = 2; this->action = this->frameIndex == 0 ? 1 : 2; this->subAction = 0; diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c index 96b4dff9..3466ce9c 100644 --- a/src/object/lilypadLarge.c +++ b/src/object/lilypadLarge.c @@ -80,7 +80,7 @@ void sub_08085504(LilypadLargeEntity* this) { super->speed = 0x100; super->spritePriority.b0 = 6; super->hitbox = &gUnk_08120640; - super->flags |= 0x80; + super->flags |= ENT_COLLIDE; super->field_0x3c = 7; super->hitType = 1; super->flags2 = 4; @@ -204,7 +204,7 @@ void sub_08085C5C(LilypadLargeEntity* this) { } } if (gRoomControls.reload_flags == 0) { - super->flags &= 0xdf; + super->flags &= ~ENT_PERSIST; super->action = 1; super->updatePriority = super->updatePriorityPrev; gRoomControls.camera_target = &gPlayerEntity; @@ -291,12 +291,12 @@ NONMATCH("asm/non_matching/lilypadLarge/sub_08085D60.inc", void sub_08085D60(Lil } } } - super->flags &= 0xdf; + super->flags &= ~ENT_PERSIST; } END_NONMATCH void sub_08085E74(LilypadLargeEntity* this) { - super->flags |= 0x20; + super->flags |= ENT_PERSIST; super->updatePriority = 6; super->action = 3; switch (super->direction) { diff --git a/src/object/warpPoint.c b/src/object/warpPoint.c index 02b73a9a..10439652 100644 --- a/src/object/warpPoint.c +++ b/src/object/warpPoint.c @@ -91,7 +91,7 @@ void sub_0808B590(Entity* this) { gPlayerEntity.x.HALF.HI = this->x.HALF.HI; gPlayerEntity.y.HALF.HI = this->y.HALF.HI; gPlayerEntity.animationState = 4; - gPlayerEntity.flags &= ~0x80; + gPlayerEntity.flags &= ~ENT_COLLIDE; RequestPriorityDuration(this, this->field_0xf + 0x10); SoundReq(SFX_113); } else { diff --git a/src/playerItem/playerItemC.c b/src/playerItem/playerItemC.c index cc494f79..aa08e1bc 100644 --- a/src/playerItem/playerItemC.c +++ b/src/playerItem/playerItemC.c @@ -19,7 +19,7 @@ void PlayerItemC(Entity* this) { void sub_0801B8B0(Entity* this) { if (gPlayerState.dash_state != 0) { gPlayerState.item = this; - this->flags |= 0x20; + this->flags |= ENT_PERSIST; this->action = 0x01; this->flags2 = 8; LoadSwapGFX(this, 1, 3); @@ -41,7 +41,7 @@ void sub_0801B8FC(Entity* this) { gPlayerState.item = NULL; DeleteThisEntity(); } else { - pbVar1->flags |= 0x80; + pbVar1->flags |= ENT_COLLIDE; pbVar1->field_0x3c = 0x21; sub_0801B938(pbVar1); } diff --git a/src/playerItem/playerItemLantern.c b/src/playerItem/playerItemLantern.c index 3b7071df..00b2f9c6 100644 --- a/src/playerItem/playerItemLantern.c +++ b/src/playerItem/playerItemLantern.c @@ -13,7 +13,7 @@ void PlayerItemLantern(Entity* this) { } void sub_08054A60(Entity* this) { - this->flags |= 0xa0; + this->flags |= (ENT_PERSIST | ENT_COLLIDE); this->action = 0x01; this->actionDelay = 0x04; this->frameIndex = -1; diff --git a/src/projectile/ballAndChain.c b/src/projectile/ballAndChain.c index c01f9a42..2f242f85 100644 --- a/src/projectile/ballAndChain.c +++ b/src/projectile/ballAndChain.c @@ -86,9 +86,9 @@ void sub_080AB170(Entity* this) { ent = parent->parent; if (this->field_0x7c.BYTES.byte0 != ent->field_0x7c.BYTES.byte0) { - this->flags |= 0x80; + this->flags |= ENT_COLLIDE; } else { - this->flags &= 0x7f; + this->flags &= ~ENT_COLLIDE; } this->field_0x7c.BYTES.byte0 = ent->field_0x7c.BYTES.byte0; diff --git a/src/projectile/gyorgMaleEnergyProjectile.c b/src/projectile/gyorgMaleEnergyProjectile.c index cfcfed29..f654133e 100644 --- a/src/projectile/gyorgMaleEnergyProjectile.c +++ b/src/projectile/gyorgMaleEnergyProjectile.c @@ -33,7 +33,7 @@ void sub_080AC8DC(Entity* this) { default: { if (this->action != 3) { this->action = 3; - this->flags &= 0x7f; + this->flags &= ~ENT_COLLIDE; this->speed >>= 1; InitializeAnimation(this, 1); } diff --git a/src/projectile/v3ElectricProjectile.c b/src/projectile/v3ElectricProjectile.c index a3461f03..869d02aa 100644 --- a/src/projectile/v3ElectricProjectile.c +++ b/src/projectile/v3ElectricProjectile.c @@ -43,7 +43,7 @@ void sub_080ABFEC(Entity* this) { } case 1: { this->action = 1; - this->flags &= 0x7f; + this->flags &= ~ENT_COLLIDE; this->cutsceneBeh.HALF.HI = 0x18; CopyPositionAndSpriteOffset(this->parent, this); this->z.HALF.HI -= 0x14; diff --git a/src/projectile/v3TennisBallProjectile.c b/src/projectile/v3TennisBallProjectile.c index 00fc5da7..b25cbf48 100644 --- a/src/projectile/v3TennisBallProjectile.c +++ b/src/projectile/v3TennisBallProjectile.c @@ -26,7 +26,7 @@ void sub_080ACA68(Entity* this) { case 0xc: case 0x6: { this->action = 2; - this->flags &= 0x7f; + this->flags &= ~ENT_COLLIDE; this->speed += 0x80 * 2; this->child = this->field_0x4c; if (sub_080ACB40(this)) {