Document Actor Category Change (#1518)

* Actor Category Change

* cleanup

* comments

* adj comment

* revert small cleanup for libc64 PR

* adjust comments
This commit is contained in:
engineer124 2023-11-27 21:02:28 +11:00 committed by GitHub
parent c04aaab6a1
commit 702f3cf44e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 92 additions and 88 deletions

View File

@ -363,7 +363,7 @@ s16 func_800BBC20(BlinkInfo* info, s16 arg1, s16 arg2, s16 arg3);
void Actor_SpawnBodyParts(Actor* actor, PlayState* play, s32 partParams, Gfx** dList);
void Actor_SpawnFloorDustRing(PlayState* play, Actor* actor, Vec3f* posXZ, f32 radius, s32 countMinusOne, f32 randAccelWeight, s16 scale, s16 scaleStep, u8 useLighting);
void func_800BBFB0(PlayState* play, Vec3f* position, f32 arg2, s32 arg3, s16 arg4, s16 scaleStep, u8 arg6);
void func_800BC154(PlayState* play, ActorContext* actorCtx, Actor* actor, u8 actorCategory);
void Actor_ChangeCategory(PlayState* play, ActorContext* actorCtx, Actor* actor, u8 actorCategory);
u32 Actor_GetArrowDmgFlags(s32 params);
Actor* func_800BC270(PlayState* play, Actor* actor, f32 distance, u32 dmgFlags);
Actor* func_800BC444(PlayState* play, Actor* actor, f32 distance);

View File

@ -382,7 +382,7 @@ typedef struct ActorContextSceneFlags {
typedef struct ActorListEntry {
/* 0x0 */ s32 length; // number of actors loaded of this type
/* 0x4 */ Actor* first; // pointer to first actor of this type
/* 0x8 */ s32 unk_08;
/* 0x8 */ s32 categoryChanged; // at least one actor has changed categories and needs to be moved to a different list
} ActorListEntry; // size = 0xC
typedef enum {

View File

@ -216,7 +216,7 @@ void FaultDrawer_FillScreen() {
}
void* FaultDrawer_FormatStringFunc(void* arg, const char* str, size_t count) {
for (; count != 0; count--, str++) {
for (; count > 0; count--, str++) {
if (sFaultDrawerInstance->escCode) {
sFaultDrawerInstance->escCode = false;
if (*str >= '1' && *str <= '9') {

View File

@ -57,7 +57,6 @@ Actor* D_801ED920; // 2 funcs. 1 out of z_actor
#define ACTOR_AUDIO_FLAG_SEQ_ALL (ACTOR_AUDIO_FLAG_SEQ_MUSIC_BOX_HOUSE | ACTOR_AUDIO_FLAG_SEQ_KAMARO_DANCE)
#define ACTOR_AUDIO_FLAG_ALL (ACTOR_AUDIO_FLAG_SFX_ALL | ACTOR_AUDIO_FLAG_SEQ_ALL)
// Internal forward declarations
void Actor_KillAllOnHalfDayChange(PlayState* play, ActorContext* actorCtx);
Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, PlayState* play);
Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play);
@ -69,17 +68,17 @@ Actor* Actor_RemoveFromCategory(PlayState* play, ActorContext* actorCtx, Actor*
void Actor_PrintLists(ActorContext* actorCtx) {
ActorListEntry* actorList = &actorCtx->actorLists[0];
Actor* actor;
s32 i;
s32 category;
FaultDrawer_SetCharPad(-2, 0);
FaultDrawer_Printf("actor\n", gMaxActorId);
FaultDrawer_Printf("No. Actor Name Part SegName\n");
for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) {
actor = actorList[i].first;
for (category = 0; category < ACTORCAT_MAX; category++) {
actor = actorList[category].first;
while (actor != NULL) {
FaultDrawer_Printf("%3d %08x %04x %3d %s\n", i, actor, actor->id, actor->category, "");
FaultDrawer_Printf("%3d %08x %04x %3d %s\n", category, actor, actor->id, actor->category, "");
actor = actor->next;
}
}
@ -2604,11 +2603,11 @@ u32 sCategoryFreezeMasks[ACTORCAT_MAX] = {
};
void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
s32 i;
s32 category;
Actor* actor;
Player* player = GET_PLAYER(play);
u32* categoryFreezeMaskP;
s32 cat;
s32 newCategory;
Actor* next;
ActorListEntry* entry;
UpdateActor_Params params;
@ -2642,8 +2641,8 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
params.talkActor = NULL;
}
for (i = 0, entry = actorCtx->actorLists; i < ARRAY_COUNT(actorCtx->actorLists);
entry++, categoryFreezeMaskP++, i++) {
for (category = 0, entry = actorCtx->actorLists; category < ACTORCAT_MAX;
entry++, categoryFreezeMaskP++, category++) {
params.canFreezeCategory = *categoryFreezeMaskP & player->stateFlags1;
params.actor = entry->first;
@ -2651,28 +2650,32 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
params.actor = Actor_UpdateActor(&params);
}
if (i == ACTORCAT_BG) {
if (category == ACTORCAT_BG) {
DynaPoly_UpdateContext(play, &play->colCtx.dyna);
}
}
for (i = 0, entry = actorCtx->actorLists; i < ARRAY_COUNT(actorCtx->actorLists); entry++, i++) {
if (entry->unk_08 != 0) {
// Move actors to a different actorList if it has changed categories.
for (category = 0, entry = actorCtx->actorLists; category < ACTORCAT_MAX; entry++, category++) {
if (entry->categoryChanged) {
actor = entry->first;
while (actor != NULL) {
if (i == actor->category) {
if (actor->category == category) {
// The actor category matches the list category. No change needed.
actor = actor->next;
} else {
continue;
}
// The actor category does not match the list category and needs to be moved.
next = actor->next;
cat = actor->category;
actor->category = i;
newCategory = actor->category;
actor->category = category;
Actor_RemoveFromCategory(play, actorCtx, actor);
Actor_AddToCategory(actorCtx, actor, cat);
Actor_AddToCategory(actorCtx, actor, newCategory);
actor = next;
}
}
entry->unk_08 = 0;
entry->categoryChanged = false;
}
}
@ -2986,7 +2989,7 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) {
ActorListEntry* actorEntry;
Actor* actor;
s32 actorFlags;
s32 i;
s32 category;
if (play->unk_18844) {
actorFlags = ACTOR_FLAG_200000;
@ -3001,7 +3004,7 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) {
sp58 = POLY_XLU_DISP;
POLY_XLU_DISP = &sp58[1];
for (i = 0, actorEntry = actorCtx->actorLists; i < ARRAY_COUNT(actorCtx->actorLists); i++, actorEntry++) {
for (category = 0, actorEntry = actorCtx->actorLists; category < ACTORCAT_MAX; category++, actorEntry++) {
actor = actorEntry->first;
while (actor != NULL) {
@ -3075,10 +3078,10 @@ void Actor_DrawAll(PlayState* play, ActorContext* actorCtx) {
*/
void Actor_KillAllWithMissingObject(PlayState* play, ActorContext* actorCtx) {
Actor* actor;
s32 i;
s32 category;
for (i = 0; i != ARRAY_COUNT(actorCtx->actorLists); i++) {
actor = actorCtx->actorLists[i].first;
for (category = 0; category < ACTORCAT_MAX; category++) {
actor = actorCtx->actorLists[category].first;
while (actor != NULL) {
if (!Object_IsLoaded(&play->objectCtx, actor->objectSlot)) {
@ -3095,10 +3098,10 @@ void Actor_KillAllWithMissingObject(PlayState* play, ActorContext* actorCtx) {
*/
void func_800BA798(PlayState* play, ActorContext* actorCtx) {
Actor* actor;
s32 i;
s32 category;
for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) {
actor = actorCtx->actorLists[i].first;
for (category = 0; category < ACTORCAT_MAX; category++) {
actor = actorCtx->actorLists[category].first;
while (actor != NULL) {
if ((actor->room >= 0) && (actor->room != play->roomCtx.curRoom.num) &&
@ -3127,10 +3130,10 @@ void func_800BA798(PlayState* play, ActorContext* actorCtx) {
* Kill every actor which does not have the current halfDayBit enabled
*/
void Actor_KillAllOnHalfDayChange(PlayState* play, ActorContext* actorCtx) {
s32 i;
s32 category;
for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) {
Actor* actor = actorCtx->actorLists[i].first;
for (category = 0; category < ACTORCAT_MAX; category++) {
Actor* actor = actorCtx->actorLists[category].first;
while (actor != NULL) {
if (!(actor->halfDaysBits & actorCtx->halfDaysBit)) {
@ -3154,17 +3157,17 @@ void Actor_KillAllOnHalfDayChange(PlayState* play, ActorContext* actorCtx) {
}
void Actor_CleanupContext(ActorContext* actorCtx, PlayState* play) {
s32 i;
s32 category;
Fault_RemoveClient(&sActorFaultClient);
for (i = 0; i < ARRAY_COUNT(actorCtx->actorLists); i++) {
if (i != ACTORCAT_PLAYER) {
Actor* actor = actorCtx->actorLists[i].first;
for (category = 0; category < ACTORCAT_MAX; category++) {
if (category != ACTORCAT_PLAYER) {
Actor* actor = actorCtx->actorLists[category].first;
while (actor != NULL) {
Actor_Delete(actorCtx, actor, play);
actor = actorCtx->actorLists[i].first;
actor = actorCtx->actorLists[category].first;
}
}
}
@ -3797,8 +3800,8 @@ void func_800BBFB0(PlayState* play, Vec3f* position, f32 arg2, s32 arg3, s16 arg
}
}
void func_800BC154(PlayState* play, ActorContext* actorCtx, Actor* actor, u8 actorCategory) {
actorCtx->actorLists[actor->category].unk_08 = 1;
void Actor_ChangeCategory(PlayState* play, ActorContext* actorCtx, Actor* actor, u8 actorCategory) {
actorCtx->actorLists[actor->category].categoryChanged = true;
actor->category = actorCategory;
}
@ -4663,7 +4666,7 @@ Actor* Actor_FindNearby(PlayState* play, Actor* inActor, s16 actorId, u8 actorCa
Actor* actor = play->actorCtx.actorLists[actorCategory].first;
while (actor != NULL) {
if (actor == inActor || ((actorId != -1) && (actorId != actor->id))) {
if ((actor == inActor) || ((actorId != -1) && (actorId != actor->id))) {
actor = actor->next;
continue;
}

View File

@ -75,7 +75,7 @@ f32 CollisionCheck_GetDamageAndEffectOnBumper(Collider* at, ColliderInfo* atInfo
if (ac->actor->colChkInfo.damageTable != NULL) {
dmgFlags = atInfo->toucher.dmgFlags;
for (i = 0; i != ARRAY_COUNT(ac->actor->colChkInfo.damageTable->attack); i++) {
for (i = 0; i < ARRAY_COUNT(ac->actor->colChkInfo.damageTable->attack); i++) {
if (dmgFlags == 1) {
break;
}

View File

@ -284,7 +284,7 @@ void func_80122D44(PlayState* play, struct_80122D44_arg1* arg1) {
OPEN_DISPS(play->state.gfxCtx);
for (i = 0; i != ARRAY_COUNT(arg1->unk_04); i++) {
for (i = 0; i < ARRAY_COUNT(arg1->unk_04); i++) {
if ((phi_s2->alpha != 0) && (phi_s2->alpha != 255)) {
temp_s3 = &D_801BFDD0[phi_s2->unk_00 - 1];
Matrix_Put(&phi_s2->mf);

View File

@ -1309,7 +1309,7 @@ void Sram_OpenSave(FileSelectState* fileSelect, SramContext* sramCtx) {
Lib_MemCpy(gScarecrowSpawnSongPtr, gSaveContext.save.saveInfo.scarecrowSpawnSong,
sizeof(gSaveContext.save.saveInfo.scarecrowSpawnSong));
for (i = 0; i != ARRAY_COUNT(gSaveContext.save.saveInfo.scarecrowSpawnSong); i++) {}
for (i = 0; i < ARRAY_COUNT(gSaveContext.save.saveInfo.scarecrowSpawnSong); i++) {}
}
fileNum = gSaveContext.fileNum;

View File

@ -400,7 +400,7 @@ void func_80B16244(BgHakuginSwitch* this, PlayState* play) {
this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y;
if ((BGHAKUGINSWITCH_GET_7(&this->dyna.actor) == BGHAKUGINSWITCH_GET_7_1) &&
(this->dyna.actor.category != ACTORCAT_SWITCH)) {
func_800BC154(play, &play->actorCtx, &this->dyna.actor, 0);
Actor_ChangeCategory(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_SWITCH);
}
this->actionFunc = func_80B162AC;
}
@ -459,7 +459,7 @@ void func_80B16494(BgHakuginSwitch* this, PlayState* play) {
this->dyna.actor.world.pos.y = (this->dyna.actor.home.pos.y - (1800.0f * this->dyna.actor.scale.y)) + 2.0f;
if ((BGHAKUGINSWITCH_GET_7(&this->dyna.actor) == BGHAKUGINSWITCH_GET_7_1) &&
(this->dyna.actor.category != ACTORCAT_PROP)) {
func_800BC154(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_PROP);
Actor_ChangeCategory(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_PROP);
}
this->actionFunc = func_80B16520;
}

View File

@ -2107,7 +2107,7 @@ void Boss01_SetupDeathCutscene(Boss01* this, PlayState* play) {
this->cutsceneState = ODOLWA_DEATH_CS_STATE_STARTED;
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 1);
sMothSwarm->unk_144 = 250;
func_800BC154(play, &play->actorCtx, &sMothSwarm->actor, ACTORCAT_BOSS);
Actor_ChangeCategory(play, &play->actorCtx, &sMothSwarm->actor, ACTORCAT_BOSS);
}
/**

View File

@ -388,7 +388,7 @@ void Boss05_Init(Actor* thisx, PlayState* play) {
this->dyna.actor.params = BIO_BABA_TYPE_LILY_PAD;
this->actionFunc = Boss05_LilyPad_Idle;
this->dyna.actor.flags &= ~ACTOR_FLAG_TARGETABLE;
func_800BC154(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_BG);
Actor_ChangeCategory(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_BG);
}
} else if (BIO_BABA_GET_TYPE(&this->dyna.actor) == BIO_BABA_TYPE_LILY_PAD) {
this->actionFunc = Boss05_LilyPad_Idle;
@ -399,7 +399,7 @@ void Boss05_Init(Actor* thisx, PlayState* play) {
SkelAnime_InitFlex(play, &this->lilyPadSkelAnime, &gBioDekuBabaLilyPadSkel, &gBioDekuBabaLilyPadIdleAnim,
this->lilyPadJointTable, this->lilyPadMorphTable, BIO_DEKU_BABA_LILY_PAD_LIMB_MAX);
this->dyna.actor.flags &= ~ACTOR_FLAG_TARGETABLE;
func_800BC154(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_BG);
Actor_ChangeCategory(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_BG);
} else if (BIO_BABA_GET_TYPE(&this->dyna.actor) == BIO_BABA_TYPE_FALLING_HEAD) {
this->actionFunc = Boss05_FallingHead_Fall;
this->fallingHeadLilyPadLimbScale = 1.0f;
@ -781,7 +781,7 @@ void Boss05_LilyPadWithHead_Move(Boss05* this, PlayState* play) {
this->dyna.actor.params = BIO_BABA_TYPE_LILY_PAD;
this->actionFunc = Boss05_LilyPad_Idle;
this->dyna.actor.flags &= ~ACTOR_FLAG_TARGETABLE;
func_800BC154(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_BG);
Actor_ChangeCategory(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_BG);
if (this->forceDetachTimer != 0) {
hitReaction = BIO_BABA_HEAD_HIT_REACTION_DEATCH;
}

View File

@ -105,7 +105,7 @@ void EnBee_Init(Actor* thisx, PlayState* play) {
this->actor.shape.shadowScale = 12.0f;
if (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) {
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ITEMACTION);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ITEMACTION);
}
this->actor.hintId = TATL_HINT_ID_GIANT_BEE;
@ -151,7 +151,7 @@ void EnBee_FlyIdle(EnBee* this, PlayState* play) {
s32 pad[2];
if ((this->actor.category != ACTORCAT_ENEMY) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE)) {
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
}
Math_Vec3f_Copy(&nextPos, &this->targetPos[this->posIndex]);

View File

@ -748,7 +748,7 @@ void EnBigpo_SetupLanternDrop(EnBigpo* this, PlayState* play) {
this->actor.shape.rot.x = -0x8000;
this->actor.velocity.y = 0.0f;
this->actor.world.pos.y -= 15.0f;
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_MISC);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_MISC);
this->actor.flags &= ~(ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY); // targetable OFF, enemy music OFF
this->actor.bgCheckFlags &= ~BGCHECKFLAG_PLAYER_400;
this->actionFunc = EnBigpo_LanternFalling;
@ -895,7 +895,7 @@ void EnBigpo_SelectRandomFireLocations(EnBigpo* this, PlayState* play) {
Math_Vec3f_Copy(&this->fires[fireIndex].pos, &randomFirePo->actor.world.pos);
randomFirePo->actor.parent = (Actor*)this;
randomFirePo->actor.update = EnBigpo_UpdateFire;
func_800BC154(play, &play->actorCtx, &randomFirePo->actor, ACTORCAT_PROP);
Actor_ChangeCategory(play, &play->actorCtx, &randomFirePo->actor, ACTORCAT_PROP);
randomFirePo->unk20C = fireIndex;
randomFirePo->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
// make invisible by size: 0

View File

@ -116,7 +116,7 @@ void EnBombf_Init(Actor* thisx, PlayState* play2) {
this->timer = 140;
this->unk_1FE = 15;
thisx->gravity = -1.5f;
func_800BC154(play, &play->actorCtx, thisx, 3);
Actor_ChangeCategory(play, &play->actorCtx, thisx, ACTORCAT_EXPLOSIVES);
thisx->colChkInfo.mass = 200;
thisx->flags &= ~ACTOR_FLAG_TARGETABLE;
EnBombf_SetupAction(this, func_808AEE3C);

View File

@ -1043,7 +1043,7 @@ void EnDekubaba_SetupDeadStickDrop(EnDekubaba* this, PlayState* play) {
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.shape.shadowScale = 3.0f;
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_MISC);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_MISC);
this->actor.flags &= ~ACTOR_FLAG_20;
this->timer = 200;
this->drawDmgEffAlpha = 0.0f;

View File

@ -1143,7 +1143,7 @@ void func_8089D018(EnDinofos* this, PlayState* play) {
s32 temp_v0 = this->unk_288 - 10;
if (this->actor.category == ACTORCAT_ENEMY) {
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
func_8089ABF4(this, play);
}

View File

@ -958,7 +958,7 @@ void EnFishing_Init(Actor* thisx, PlayState* play2) {
if (thisx->params == 200) {
this->unk_150 = 100;
func_800BC154(play, &play->actorCtx, thisx, ACTORCAT_PROP);
Actor_ChangeCategory(play, &play->actorCtx, thisx, ACTORCAT_PROP);
thisx->targetMode = TARGET_MODE_0;
thisx->flags |= (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY);
this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo);

View File

@ -656,7 +656,7 @@ void func_809336C0(EnFz* this, PlayState* play) {
this->actor.flags &= ~ACTOR_FLAG_TARGETABLE;
this->unk_BD7 = 0;
this->unk_BCA = 60;
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
Item_DropCollectibleRandom(play, &this->actor, &this->actor.world.pos, 0xA0);
this->actionFunc = func_80933760;
}

View File

@ -1166,7 +1166,7 @@ void EnJso_SetupFallDownAndTalk(EnJso* this, PlayState* play) {
this->textIndex = 2;
this->actor.colChkInfo.mass = MASS_IMMOVABLE;
this->actor.flags |= (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY);
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_NPC);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_NPC);
this->actor.flags &= ~ACTOR_FLAG_CANT_LOCK_ON;
this->actor.flags &= ~ACTOR_FLAG_100000;
this->action = EN_JSO_ACTION_FALL_DOWN_AND_TALK;

View File

@ -485,7 +485,7 @@ void EnKarebaba_SetupDeadItemDrop(EnKarebaba* this, PlayState* play) {
this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.shape.shadowScale = 3.0f;
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_MISC);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_MISC);
this->timer = 200;
this->actor.flags &= ~ACTOR_FLAG_20;
this->drawDmgEffAlpha = 0.0f;
@ -553,7 +553,7 @@ void EnKarebaba_Regrow(EnKarebaba* this, PlayState* play) {
this->actor.flags &= ~ACTOR_FLAG_10;
this->actor.flags |= (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY);
if (this->actor.params == ENKAREBABA_1) {
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
}
EnKarebaba_SetupIdle(this);
}

View File

@ -864,7 +864,7 @@ void EnKusa2_Init(Actor* thisx, PlayState* play) {
this->actor.update = func_80A5E604;
this->actor.draw = NULL;
this->actor.flags |= ACTOR_FLAG_20;
func_800BC154(play, &play->actorCtx, &this->actor, 1);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_BG);
this->unk_1BE = 0;
if (D_80A5EAEC != 0) {
D_80A5EAEC = 0;

View File

@ -274,7 +274,7 @@ void EnMnk_MonkeyTiedUp_Init(Actor* thisx, PlayState* play) {
void EnMnk_MonkeyHanging_Init(Actor* thisx, PlayState* play) {
EnMnk* this = THIS;
func_800BC154(play, &play->actorCtx, &this->picto.actor, ACTORCAT_PROP);
Actor_ChangeCategory(play, &play->actorCtx, &this->picto.actor, ACTORCAT_PROP);
this->actionFunc = EnMnk_MonkeyHanging_StruggleBeforeDunk;
this->picto.actor.textId = 0x8E8;
SkelAnime_InitFlex(play, &this->propSkelAnime, &gMonkeyHangingRopeSkel, &gMonkeyHangingStruggleAnim,

View File

@ -576,7 +576,7 @@ void func_80B2DC50(EnPoh* this, PlayState* play) {
this->actor.shape.yOffset = 1500.0f;
this->actor.world.pos.y -= 15.0f;
this->actor.shape.rot.x = -0x8000;
func_800BC154(play, &play->actorCtx, &this->actor, 8);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_MISC);
this->actor.flags &= ~(ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY);
this->actionFunc = func_80B2DD2C;
}

View File

@ -537,7 +537,7 @@ void EnRaf_Explode(EnRaf* this, PlayState* play) {
this->timer = 5;
if (this->grabTarget == EN_RAF_GRAB_TARGET_EXPLOSIVE) {
func_800BC154(play, &play->actorCtx, &this->dyna.actor, 5);
Actor_ChangeCategory(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_ENEMY);
this->dyna.actor.flags |= (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY);
}
@ -551,7 +551,7 @@ void EnRaf_PostDetonation(EnRaf* this, PlayState* play) {
if (this->timer == 0) {
this->collider.dim.radius = 50;
this->collider.dim.height = 10;
func_800BC154(play, &play->actorCtx, &this->dyna.actor, 6);
Actor_ChangeCategory(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_PROP);
this->dyna.actor.flags &= ~(ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_UNFRIENDLY);
EnRaf_SetupDormant(this);
} else if (this->grabTarget == EN_RAF_GRAB_TARGET_EXPLOSIVE) {

View File

@ -1051,7 +1051,7 @@ void EnRd_SetupDead(EnRd* this) {
void EnRd_Dead(EnRd* this, PlayState* play) {
if (this->actor.category != ACTORCAT_PROP) {
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
}
Math_SmoothStepToS(&this->headYRotation, 0, 1, 2000, 0);

View File

@ -629,7 +629,7 @@ void func_808D9F08(EnSw* this) {
void func_808D9F78(EnSw* this, PlayState* play, s32 arg2) {
if (arg2 != 0) {
func_800BC154(play, &play->actorCtx, &this->actor, 5);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
}
Actor_SetScale(&this->actor, 0.02f);
func_808D9DA0(this);
@ -1061,7 +1061,7 @@ void func_808DB100(EnSw* this, PlayState* play) {
this->unk_456 = 0;
this->unk_454 = 0;
this->skelAnime.curFrame = 0.0f;
func_800BC154(play, &play->actorCtx, &this->actor, 4);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_NPC);
this->actionFunc = func_808DB25C;
return;
}
@ -1113,7 +1113,7 @@ void func_808DB2E0(EnSw* this, PlayState* play) {
if ((s32)temp_f2 != 0) {
Actor_PlaySfx(&this->actor, NA_SE_EN_STALTURA_BOUND);
} else {
func_800BC154(play, &play->actorCtx, &this->actor, 5);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
Math_Vec3f_Copy(&this->actor.velocity, &gZeroVec3f);
this->unk_410 &= ~(0x10 | 0x1);
this->actionFunc = func_808DB100;

View File

@ -128,7 +128,7 @@ void EnTanron2_Init(Actor* thisx, PlayState* play) {
if (this->actor.params == 100) {
this->actor.update = func_80BB7B90;
func_800BC154(play, &play->actorCtx, &this->actor, 5);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
return;
}

View File

@ -525,8 +525,8 @@ s32 func_80A3F09C(EnTest3* this, PlayState* play) {
}
void func_80A3F0B0(EnTest3* this, PlayState* play) {
func_800BC154(play, &play->actorCtx, &this->unk_D90->actor, 2);
func_800BC154(play, &play->actorCtx, &this->player.actor, 4);
Actor_ChangeCategory(play, &play->actorCtx, &this->unk_D90->actor, ACTORCAT_PLAYER);
Actor_ChangeCategory(play, &play->actorCtx, &this->player.actor, ACTORCAT_NPC);
this->unk_D90->stateFlags1 &= ~PLAYER_STATE1_20;
}
@ -669,8 +669,8 @@ s32 func_80A3F73C(EnTest3* this, PlayState* play) {
play->actorCtx.flags &= ~ACTORCTX_FLAG_4;
this->player.stateFlags2 &= ~PLAYER_STATE2_40000;
this->unk_D90->stateFlags1 |= PLAYER_STATE1_20;
func_800BC154(play, &play->actorCtx, &this->unk_D90->actor, 4);
func_800BC154(play, &play->actorCtx, &this->player.actor, 2);
Actor_ChangeCategory(play, &play->actorCtx, &this->unk_D90->actor, ACTORCAT_NPC);
Actor_ChangeCategory(play, &play->actorCtx, &this->player.actor, ACTORCAT_PLAYER);
CutsceneManager_SetReturnCamera(this->subCamId);
play->tryPlayerCsAction(play, &this->player, PLAYER_CSACTION_WAIT);
}

View File

@ -118,7 +118,7 @@ void func_80ADFCEC(EnTsn* this, PlayState* play) {
if (this->unk_1D8 == NULL) {
Actor_Kill(&this->actor);
} else if ((ENTSN_GET_F(&this->actor)) == ENTSN_F_1) {
func_800BC154(play, &play->actorCtx, &this->actor, 6);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
}
}

View File

@ -234,7 +234,7 @@ void EnTuboTrap_Idle(EnTuboTrap* this, PlayState* play) {
if ((this->actor.xzDistToPlayer < 200.0f) && (this->actor.world.pos.y <= player->actor.world.pos.y)) {
startingRotation = this->actor.home.rot.z;
if ((startingRotation == 0) || (this->actor.playerHeightRel <= (startingRotation * 10.0f))) {
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
currentHeight = this->actor.world.pos.y;
this->actor.flags |= (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_10); // always update and can target

View File

@ -91,7 +91,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) {
break;
case WEATHERTAG_TYPE_UNK5:
func_800BC154(play, &play->actorCtx, &this->actor, 7);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ITEMACTION);
play->skyboxId = SKYBOX_3;
play->envCtx.lightConfig = 5;
play->envCtx.changeLightNextConfig = 5;

View File

@ -339,7 +339,7 @@ void EnWf_Init(Actor* thisx, PlayState* play) {
func_80992FD4(this);
}
func_800BC154(play, &play->actorCtx, &this->actor, 5);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
if (D_809942D8 == 0) {
for (i = 0; i < ARRAY_COUNT(sNormalEyeTextures); i++) {

View File

@ -382,7 +382,7 @@ void ObjBean_Init(Actor* thisx, PlayState* play) {
return;
}
func_800BC154(play, &play->actorCtx, &this->dyna.actor, 7);
Actor_ChangeCategory(play, &play->actorCtx, &this->dyna.actor, ACTORCAT_ITEMACTION);
func_80937DD8(this);
} else {
s32 params2 = OBJBEAN_GET_3F00(&this->dyna.actor);

View File

@ -314,7 +314,7 @@ void ObjMure_SetChildToFollowPlayer(ObjMure* this, s32 idx1) {
i2++;
this->children[i]->child = this->children[i];
for (j = 0; j < maxChildren; j++) {
if (i != j && this->children[j]->child == this->children[i]) {
if ((i != j) && (this->children[j]->child == this->children[i])) {
this->children[j]->child = NULL;
}
}

View File

@ -55,7 +55,7 @@ void func_80973CD8(ObjRoomtimer* this, PlayState* play) {
Interface_StartTimer(TIMER_ID_MINIGAME_2, this->actor.params);
}
func_800BC154(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_PROP);
this->actionFunc = func_80973D3C;
}

View File

@ -111,7 +111,7 @@ void func_80C07F30(ObjUsiyane* this, PlayState* play) {
for (i = 0; i < ARRAY_COUNT(this->unk_168[0]); i++) {
for (j = 0; j < ARRAY_COUNT(this->unk_168); j++) {
if (i != ARRAY_COUNT(this->unk_168[0]) - 1) {
if (i != (ARRAY_COUNT(this->unk_168[0]) - 1)) {
func_80C07DFC(&this->unk_710[i], &D_80C08660[i].rot, &this->unk_710[i + 1], &D_80C08660[i + 1].rot, j,
10, &this->unk_168[j][i].unk_00, &this->unk_168[j][i].unk_18);
} else {

View File

@ -850,7 +850,7 @@
0x800BBCEC:("Actor_SpawnBodyParts",),
0x800BBDAC:("Actor_SpawnFloorDustRing",),
0x800BBFB0:("func_800BBFB0",),
0x800BC154:("func_800BC154",),
0x800BC154:("Actor_ChangeCategory",),
0x800BC188:("Actor_GetArrowDmgFlags",),
0x800BC1B4:("func_800BC1B4",),
0x800BC270:("func_800BC270",),

View File

@ -149,6 +149,7 @@ wordReplace = {
"Actor_MarkForDeath": "Actor_Kill",
"func_800B84D0": "Actor_TalkOfferAccepted",
"Actor_ProcessTalkRequest": "Actor_TalkOfferAccepted",
"func_800BC154": "Actor_ChangeCategory",
"func_8017D668": "Math3D_PointDistToLine2D",
"THGA_GetSize": "THGA_GetRemaining",

View File

@ -364,7 +364,7 @@ asm/non_matchings/code/z_actor/func_800BBC20.s,func_800BBC20,0x800BBC20,0x33
asm/non_matchings/code/z_actor/Actor_SpawnBodyParts.s,Actor_SpawnBodyParts,0x800BBCEC,0x30
asm/non_matchings/code/z_actor/Actor_SpawnFloorDustRing.s,Actor_SpawnFloorDustRing,0x800BBDAC,0x81
asm/non_matchings/code/z_actor/func_800BBFB0.s,func_800BBFB0,0x800BBFB0,0x69
asm/non_matchings/code/z_actor/func_800BC154.s,func_800BC154,0x800BC154,0xD
asm/non_matchings/code/z_actor/Actor_ChangeCategory.s,Actor_ChangeCategory,0x800BC154,0xD
asm/non_matchings/code/z_actor/Actor_GetArrowDmgFlags.s,Actor_GetArrowDmgFlags,0x800BC188,0xB
asm/non_matchings/code/z_actor/func_800BC1B4.s,func_800BC1B4,0x800BC1B4,0x2F
asm/non_matchings/code/z_actor/func_800BC270.s,func_800BC270,0x800BC270,0x75

1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
364 asm/non_matchings/code/z_actor/Actor_SpawnBodyParts.s Actor_SpawnBodyParts 0x800BBCEC 0x30
365 asm/non_matchings/code/z_actor/Actor_SpawnFloorDustRing.s Actor_SpawnFloorDustRing 0x800BBDAC 0x81
366 asm/non_matchings/code/z_actor/func_800BBFB0.s func_800BBFB0 0x800BBFB0 0x69
367 asm/non_matchings/code/z_actor/func_800BC154.s asm/non_matchings/code/z_actor/Actor_ChangeCategory.s func_800BC154 Actor_ChangeCategory 0x800BC154 0xD
368 asm/non_matchings/code/z_actor/Actor_GetArrowDmgFlags.s Actor_GetArrowDmgFlags 0x800BC188 0xB
369 asm/non_matchings/code/z_actor/func_800BC1B4.s func_800BC1B4 0x800BC1B4 0x2F
370 asm/non_matchings/code/z_actor/func_800BC270.s func_800BC270 0x800BC270 0x75