1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-23 15:31:15 +00:00

Use defines for actor flags (#873)

* Add ACTOR_FLAG_ defines

* Add ACTOR_FLAGS_ALL macro and use ACTOR_FLAG_* constants everywhere

* Remove unused ACTOR_FLAG_* constants

* actor flags in bigokuta & ko

* actor flags in obj_mure

* actor flags in stalfos, twinrova & ganon2

* actor flags in morpha & barinade

* name some previously missed actor flags

* found some comments using hex for actor flags

* Actor flags in ovl_En_Ganon_Mant

* Actor flags in EnWf

* Flags in en_zf

* Actor flags in BossGanon (FeelsOKMan)

* Remove `ACTOR_FLAG_NONE`

* Wrap expansion of `FLAGS` in parentheses

* `ACTOR_FLAGS_ALL` -> `CHECK_FLAG_ALL`

* Move `CHECK_FLAG_ALL` to `macros.h`

* Run formatter
This commit is contained in:
Dragorn421 2021-12-06 01:11:38 +01:00 committed by GitHub
parent 79220ba58a
commit a9284494f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
439 changed files with 1342 additions and 1304 deletions

View file

@ -7,7 +7,7 @@
#include "z_en_arrow.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#define FLAGS 0x00000030
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5)
void EnArrow_Init(Actor* thisx, GlobalContext* globalCtx);
void EnArrow_Destroy(Actor* thisx, GlobalContext* globalCtx);
@ -148,7 +148,7 @@ void EnArrow_Destroy(Actor* thisx, GlobalContext* globalCtx) {
Collider_DestroyQuad(globalCtx, &this->collider);
if ((this->hitActor != NULL) && (this->hitActor->update != NULL)) {
this->hitActor->flags &= ~0x8000;
this->hitActor->flags &= ~ACTOR_FLAG_15;
}
}
@ -288,11 +288,11 @@ void EnArrow_Fly(EnArrow* this, GlobalContext* globalCtx) {
hitActor = this->collider.base.at;
if ((hitActor->update != NULL) && (!(this->collider.base.atFlags & AT_BOUNCED)) &&
(hitActor->flags & 0x4000)) {
(hitActor->flags & ACTOR_FLAG_14)) {
this->hitActor = hitActor;
EnArrow_CarryActor(this, globalCtx);
Math_Vec3f_Diff(&hitActor->world.pos, &this->actor.world.pos, &this->unk_250);
hitActor->flags |= 0x8000;
hitActor->flags |= ACTOR_FLAG_15;
this->collider.base.atFlags &= ~AT_HIT;
this->actor.speedXZ /= 2.0f;
this->actor.velocity.y /= 2.0f;
@ -351,14 +351,14 @@ void EnArrow_Fly(EnArrow* this, GlobalContext* globalCtx) {
this->hitActor->world.pos.y = hitPoint.y + ((sp54.y <= hitPoint.y) ? 1.0f : -1.0f);
this->hitActor->world.pos.z = hitPoint.z + ((sp54.z <= hitPoint.z) ? 1.0f : -1.0f);
Math_Vec3f_Diff(&this->hitActor->world.pos, &this->actor.world.pos, &this->unk_250);
this->hitActor->flags &= ~0x8000;
this->hitActor->flags &= ~ACTOR_FLAG_15;
this->hitActor = NULL;
} else {
Math_Vec3f_Sum(&this->actor.world.pos, &this->unk_250, &this->hitActor->world.pos);
}
if (this->touchedPoly && (this->hitActor != NULL)) {
this->hitActor->flags &= ~0x8000;
this->hitActor->flags &= ~ACTOR_FLAG_15;
this->hitActor = NULL;
}
} else {