mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-21 06:21:16 +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:
parent
79220ba58a
commit
a9284494f2
439 changed files with 1342 additions and 1304 deletions
|
@ -1,6 +1,6 @@
|
|||
#include "z_arms_hook.h"
|
||||
|
||||
#define FLAGS 0x00000030
|
||||
#define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5)
|
||||
|
||||
void ArmsHook_Init(Actor* thisx, GlobalContext* globalCtx);
|
||||
void ArmsHook_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
||||
|
@ -77,7 +77,7 @@ void ArmsHook_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
ArmsHook* this = (ArmsHook*)thisx;
|
||||
|
||||
if (this->grabbed != NULL) {
|
||||
this->grabbed->flags &= ~0x2000;
|
||||
this->grabbed->flags &= ~ACTOR_FLAG_13;
|
||||
}
|
||||
Collider_DestroyQuad(globalCtx, &this->collider);
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ s32 ArmsHook_AttachToPlayer(ArmsHook* this, Player* player) {
|
|||
|
||||
void ArmsHook_DetachHookFromActor(ArmsHook* this) {
|
||||
if (this->grabbed != NULL) {
|
||||
this->grabbed->flags &= ~0x2000;
|
||||
this->grabbed->flags &= ~ACTOR_FLAG_13;
|
||||
this->grabbed = NULL;
|
||||
}
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) {
|
|||
Player* player = (Player*)this->actor.parent;
|
||||
|
||||
if (Player_HoldsHookshot(player)) {
|
||||
if ((player->itemActionParam != player->heldItemActionParam) || ((player->actor.flags & 0x100)) ||
|
||||
if ((player->itemActionParam != player->heldItemActionParam) || (player->actor.flags & ACTOR_FLAG_8) ||
|
||||
((player->stateFlags1 & 0x4000080))) {
|
||||
this->timer = 0;
|
||||
ArmsHook_DetachHookFromActor(this);
|
||||
|
@ -134,7 +134,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) {
|
|||
}
|
||||
|
||||
void ArmsHook_AttachHookToActor(ArmsHook* this, Actor* actor) {
|
||||
actor->flags |= 0x2000;
|
||||
actor->flags |= ACTOR_FLAG_13;
|
||||
this->grabbed = actor;
|
||||
Math_Vec3f_Diff(&actor->world.pos, &this->actor.world.pos, &this->grabbedDistDiff);
|
||||
}
|
||||
|
@ -173,10 +173,10 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
|
|||
if ((this->timer != 0) && (this->collider.base.atFlags & AT_HIT) &&
|
||||
(this->collider.info.atHitInfo->elemType != ELEMTYPE_UNK4)) {
|
||||
touchedActor = this->collider.base.at;
|
||||
if ((touchedActor->update != NULL) && (touchedActor->flags & 0x600)) {
|
||||
if ((touchedActor->update != NULL) && (touchedActor->flags & (ACTOR_FLAG_9 | ACTOR_FLAG_10))) {
|
||||
if (this->collider.info.atHitInfo->bumperFlags & BUMP_HOOKABLE) {
|
||||
ArmsHook_AttachHookToActor(this, touchedActor);
|
||||
if ((touchedActor->flags & 0x400) == 0x400) {
|
||||
if (CHECK_FLAG_ALL(touchedActor->flags, ACTOR_FLAG_10)) {
|
||||
func_80865044(this);
|
||||
}
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
|
|||
} else if (DECR(this->timer) == 0) {
|
||||
grabbed = this->grabbed;
|
||||
if (grabbed != NULL) {
|
||||
if ((grabbed->update == NULL) || (grabbed->flags & 0x2000) != 0x2000) {
|
||||
if ((grabbed->update == NULL) || !CHECK_FLAG_ALL(grabbed->flags, ACTOR_FLAG_13)) {
|
||||
grabbed = NULL;
|
||||
this->grabbed = NULL;
|
||||
} else if (this->actor.child != NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue