mirror of
https://github.com/zeldaret/mm.git
synced 2026-08-05 17:43:19 -04:00
SubS Actor Getters OK (#475)
* Bring over matching actor getters * Add arg names * Rename functions * Adjust rename_sym script to update sizes csvs * Fix wrong function prototype * whitespace * Rename functions * Fix actorfixer * Format * Add function comments and file header * Fix merge * format * Fix merge * format * Move D_0407D590 down * Fix merge * Steal idea from z_actor PR to return directly * Swap function name order * Fix merge
This commit is contained in:
+1
-1
@@ -66,7 +66,7 @@ Actor* EnHy_FindNearestDoor(Actor* actor, GlobalContext* globalCtx) {
|
||||
f32 minDist = 0.0f;
|
||||
|
||||
do {
|
||||
doorIter = func_ActorCategoryIterateById(globalCtx, doorIter, ACTORCAT_DOOR, ACTOR_EN_DOOR);
|
||||
doorIter = SubS_FindActor(globalCtx, doorIter, ACTORCAT_DOOR, ACTOR_EN_DOOR);
|
||||
door = doorIter;
|
||||
dist = Actor_DistanceBetweenActors(actor, door);
|
||||
if (!isSetup || (dist < minDist)) {
|
||||
|
||||
+107
-5
@@ -1,6 +1,40 @@
|
||||
#include "global.h"
|
||||
/*
|
||||
* File: z_sub_s.c
|
||||
* Description: Various miscellaneous helpers
|
||||
*/
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013A7C0.s")
|
||||
#include "global.h"
|
||||
#include "overlays/actors/ovl_En_Door/z_en_door.h"
|
||||
|
||||
/**
|
||||
* Finds the first EnDoor instance with unk_1A4 == 5 and the specified unk_1A5.
|
||||
*/
|
||||
EnDoor* SubS_FindDoor(GlobalContext* globalCtx, s32 unk_1A5) {
|
||||
Actor* actor = NULL;
|
||||
EnDoor* door;
|
||||
|
||||
while (true) {
|
||||
actor = SubS_FindActor(globalCtx, actor, ACTORCAT_DOOR, ACTOR_EN_DOOR);
|
||||
door = (EnDoor*)actor;
|
||||
|
||||
if (actor == NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ((door->unk_1A4 == 5) && (door->unk_1A5 == (u8)unk_1A5)) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (actor->next == NULL) {
|
||||
door = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
actor = actor->next;
|
||||
}
|
||||
|
||||
return door;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013A860.s")
|
||||
|
||||
@@ -26,7 +60,40 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013BB34.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013BB7C.s")
|
||||
/**
|
||||
* Finds the nearest actor instance of a specified Id and category to an actor.
|
||||
*/
|
||||
Actor* SubS_FindNearestActor(Actor* actor, GlobalContext* globalCtx, u8 actorCategory, s16 actorId) {
|
||||
Actor* actorIter = NULL;
|
||||
Actor* actorTmp;
|
||||
f32 dist;
|
||||
Actor* closestActor = NULL;
|
||||
f32 minDist = 99999.0f;
|
||||
s32 isSetup = false;
|
||||
|
||||
do {
|
||||
actorIter = SubS_FindActor(globalCtx, actorIter, actorCategory, actorId);
|
||||
|
||||
actorTmp = actorIter;
|
||||
if (actorTmp == NULL) {
|
||||
break;
|
||||
}
|
||||
actorIter = actorTmp;
|
||||
|
||||
if (actorIter != actor) {
|
||||
dist = Actor_DistanceBetweenActors(actor, actorIter);
|
||||
if (!isSetup || dist < minDist) {
|
||||
closestActor = actorIter;
|
||||
minDist = dist;
|
||||
isSetup = true;
|
||||
}
|
||||
}
|
||||
|
||||
actorIter = actorIter->next;
|
||||
} while (actorIter != NULL);
|
||||
|
||||
return closestActor;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013BC6C.s")
|
||||
|
||||
@@ -68,7 +135,22 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D924.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_ActorCategoryIterateById.s")
|
||||
/**
|
||||
* Finds the first actor instance of a specified Id and category.
|
||||
*/
|
||||
Actor* SubS_FindActor(GlobalContext* globalCtx, Actor* actorListStart, u8 actorCategory, s16 actorId) {
|
||||
Actor* actor = actorListStart;
|
||||
|
||||
if (actor == NULL) {
|
||||
actor = globalCtx->actorCtx.actorList[actorCategory].first;
|
||||
}
|
||||
|
||||
while (actor != NULL && actorId != actor->id) {
|
||||
actor = actor->next;
|
||||
}
|
||||
|
||||
return actor;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D9C8.s")
|
||||
|
||||
@@ -100,7 +182,27 @@
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013E5CC.s")
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013E640.s")
|
||||
/**
|
||||
* Finds the first actor instance of a specified Id and category verified with a custom callback.
|
||||
* The callback should return `true` when the actor is succesfully verified.
|
||||
*/
|
||||
Actor* SubS_FindActorCustom(GlobalContext* globalCtx, Actor* actor, Actor* actorListStart, u8 actorCategory,
|
||||
s16 actorId, void* verifyData, VerifyActor verifyActor) {
|
||||
Actor* actorIter = actorListStart;
|
||||
|
||||
if (actorListStart == NULL) {
|
||||
actorIter = globalCtx->actorCtx.actorList[actorCategory].first;
|
||||
}
|
||||
|
||||
while (actorIter != NULL && (actorId != actorIter->id ||
|
||||
(actorId == actorIter->id &&
|
||||
(verifyActor == NULL ||
|
||||
(verifyActor != NULL && !verifyActor(globalCtx, actor, actorIter, verifyData)))))) {
|
||||
actorIter = actorIter->next;
|
||||
}
|
||||
|
||||
return actorIter;
|
||||
}
|
||||
|
||||
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013E748.s")
|
||||
|
||||
|
||||
@@ -464,7 +464,7 @@ void EnBigpo_SpawnCutsceneStage8(EnBigpo* this, GlobalContext* globalCtx) {
|
||||
Play_CameraSetAtEye(globalCtx, MAIN_CAM, &subCam->at, &subCam->eye);
|
||||
this->cutsceneSubCamId = SUBCAM_FREE;
|
||||
if (this->actor.params == ENBIGPO_SUMMONED) {
|
||||
dampe = func_ActorCategoryIterateById(globalCtx, NULL, ACTORCAT_NPC, ACTOR_EN_TK);
|
||||
dampe = SubS_FindActor(globalCtx, NULL, ACTORCAT_NPC, ACTOR_EN_TK);
|
||||
if (dampe != NULL) {
|
||||
// if dampe exists, switch to viewing his running away cutscene
|
||||
dampe->params = this->actor.cutscene;
|
||||
|
||||
@@ -2585,8 +2585,7 @@ void EnBigslime_ApplyDamageEffectBigslime(EnBigslime* this, GlobalContext* globa
|
||||
EnBigslime_SetPlayerParams(this, globalCtx);
|
||||
this->rotation = 0;
|
||||
EnBigslime_SetupFreeze(this);
|
||||
minislime = (EnMinislime*)func_ActorCategoryIterateById(globalCtx, NULL, ACTORCAT_ITEMACTION,
|
||||
ACTOR_ARROW_ICE);
|
||||
minislime = (EnMinislime*)SubS_FindActor(globalCtx, NULL, ACTORCAT_ITEMACTION, ACTOR_ARROW_ICE);
|
||||
if (minislime != NULL) {
|
||||
minislime->shakeRefPos.z = -100.0f;
|
||||
}
|
||||
|
||||
@@ -116,8 +116,7 @@ void func_809CCEE8(EnBji01* this, GlobalContext* globalCtx) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this->moonsTear =
|
||||
(ObjMoonStone*)func_ActorCategoryIterateById(globalCtx, NULL, ACTORCAT_PROP, ACTOR_OBJ_MOON_STONE);
|
||||
this->moonsTear = (ObjMoonStone*)SubS_FindActor(globalCtx, NULL, ACTORCAT_PROP, ACTOR_OBJ_MOON_STONE);
|
||||
}
|
||||
func_800B8500(&this->actor, globalCtx, 60.0f, 10.0f, 0);
|
||||
}
|
||||
@@ -350,8 +349,7 @@ void EnBji01_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
func_8013E3B8(&this->actor, this->cutscenes,
|
||||
ARRAY_COUNT(this->cutscenes)); /* initializes all elements of cutscenes to -1 */
|
||||
this->moonsTear =
|
||||
(ObjMoonStone*)func_ActorCategoryIterateById(globalCtx, NULL, ACTORCAT_PROP, ACTOR_OBJ_MOON_STONE);
|
||||
this->moonsTear = (ObjMoonStone*)SubS_FindActor(globalCtx, NULL, ACTORCAT_PROP, ACTOR_OBJ_MOON_STONE);
|
||||
|
||||
switch (gSaveContext.entranceIndex) {
|
||||
case 0x4C00: /* Observatory from ECT */
|
||||
|
||||
@@ -135,7 +135,7 @@ void func_80A714B4(EnDno* this, GlobalContext* globalCtx) {
|
||||
Actor* actor = NULL;
|
||||
|
||||
do {
|
||||
actor = func_ActorCategoryIterateById(globalCtx, actor, ACTORCAT_BG, ACTOR_BG_CRACE_MOVEBG);
|
||||
actor = SubS_FindActor(globalCtx, actor, ACTORCAT_BG, ACTOR_BG_CRACE_MOVEBG);
|
||||
if (actor != NULL) {
|
||||
if ((s32)ENDNO_GET_F(actor) == ENDNO_GET_F_1) {
|
||||
Actor_SetSwitchFlag(globalCtx, ENDNO_GET_7F0(actor));
|
||||
@@ -165,8 +165,7 @@ void func_80A715DC(EnDno* this, GlobalContext* globalCtx) {
|
||||
Vec3f sp70;
|
||||
|
||||
do {
|
||||
crace =
|
||||
(BgCraceMovebg*)func_ActorCategoryIterateById(globalCtx, &crace->actor, ACTORCAT_BG, ACTOR_BG_CRACE_MOVEBG);
|
||||
crace = (BgCraceMovebg*)SubS_FindActor(globalCtx, &crace->actor, ACTORCAT_BG, ACTOR_BG_CRACE_MOVEBG);
|
||||
if (crace != NULL) {
|
||||
if (ENDNO_GET_F(&crace->actor) == ENDNO_GET_F_0 && !(crace->unk_170 & 1)) {
|
||||
if (func_8013E5CC(&crace->actor.home.pos, &crace->actor.home.rot, &D_80A73B2C, &this->actor.prevPos,
|
||||
@@ -188,7 +187,7 @@ void func_80A71788(EnDno* this, GlobalContext* globalCtx) {
|
||||
Actor* actor = NULL;
|
||||
|
||||
do {
|
||||
actor = func_ActorCategoryIterateById(globalCtx, actor, ACTORCAT_BG, ACTOR_BG_CRACE_MOVEBG);
|
||||
actor = SubS_FindActor(globalCtx, actor, ACTORCAT_BG, ACTOR_BG_CRACE_MOVEBG);
|
||||
if (actor != NULL) {
|
||||
Actor_UnsetSwitchFlag(globalCtx, ENDNO_GET_7F0(actor));
|
||||
actor = actor->next;
|
||||
@@ -202,7 +201,7 @@ void EnDno_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor* actor = NULL;
|
||||
|
||||
while (true) {
|
||||
actor = func_ActorCategoryIterateById(globalCtx, actor, ACTORCAT_NPC, ACTOR_EN_DNO);
|
||||
actor = SubS_FindActor(globalCtx, actor, ACTORCAT_NPC, ACTOR_EN_DNO);
|
||||
if (actor != NULL) {
|
||||
if (actor != thisx) {
|
||||
Actor_MarkForDeath(thisx);
|
||||
@@ -249,7 +248,7 @@ void EnDno_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Actor_MarkForDeath(thisx);
|
||||
} else {
|
||||
func_8013E1C8(&this->skelAnime, sAnimations, 13, &this->unk_32C);
|
||||
this->unk_460 = func_ActorCategoryIterateById(globalCtx, NULL, ACTORCAT_NPC, ACTOR_EN_DNQ);
|
||||
this->unk_460 = SubS_FindActor(globalCtx, NULL, ACTORCAT_NPC, ACTOR_EN_DNQ);
|
||||
if (this->unk_460 == NULL) {
|
||||
Actor_MarkForDeath(thisx);
|
||||
} else {
|
||||
|
||||
@@ -12,7 +12,10 @@ typedef struct EnDoor {
|
||||
/* 0x144 */ char unk_144[0x5C];
|
||||
/* 0x1A0 */ s8 unk_1A0;
|
||||
/* 0x1A1 */ s8 unk_1A1;
|
||||
/* 0x1A2 */ char unk_1A2[0x5];
|
||||
/* 0x1A2 */ char unk_1A2[0x2];
|
||||
/* 0x1A4 */ u8 unk_1A4;
|
||||
/* 0x1A5 */ u8 unk_1A5;
|
||||
/* 0x1A6 */ s8 unk_1A6;
|
||||
/* 0x1A7 */ s8 unk_1A7;
|
||||
/* 0x1A8 */ char unk_1A8[0x20];
|
||||
/* 0x1C8 */ EnDoorActionFunc actionFunc;
|
||||
|
||||
@@ -100,7 +100,7 @@ s32 func_80B0F660(EnGb2* this, GlobalContext* globalCtx) {
|
||||
Actor* phi_s0 = NULL;
|
||||
|
||||
while (true) {
|
||||
temp_v0 = func_ActorCategoryIterateById(globalCtx, phi_s0, ACTORCAT_NPC, ACTOR_EN_GB2);
|
||||
temp_v0 = SubS_FindActor(globalCtx, phi_s0, ACTORCAT_NPC, ACTOR_EN_GB2);
|
||||
if (temp_v0 == NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ Vec3f* func_80BB19C0(Vec3f* arg0, EnGeg* this, GlobalContext* globalCtx) {
|
||||
|
||||
u8 func_80BB1B14(EnGeg* this, GlobalContext* globalCtx) {
|
||||
Actor* explosive;
|
||||
Actor* mm = func_ActorCategoryIterateById(globalCtx, NULL, ACTORCAT_ITEMACTION, ACTOR_EN_MM);
|
||||
Actor* mm = SubS_FindActor(globalCtx, NULL, ACTORCAT_ITEMACTION, ACTOR_EN_MM);
|
||||
|
||||
if (mm != NULL) {
|
||||
this->unk_4B0 = Math_Vec3f_Yaw(&this->actor.world.pos, &mm->world.pos);
|
||||
|
||||
@@ -159,7 +159,7 @@ Actor* func_8094DEE0(EnGm* this, GlobalContext* globalCtx, u8 arg2, s16 arg3) {
|
||||
Actor* actor;
|
||||
|
||||
while (true) {
|
||||
actor = func_ActorCategoryIterateById(globalCtx, foundActor, arg2, arg3);
|
||||
actor = SubS_FindActor(globalCtx, foundActor, arg2, arg3);
|
||||
foundActor = actor;
|
||||
if (actor == NULL) {
|
||||
break;
|
||||
@@ -212,7 +212,7 @@ EnDoor* func_8094DF90(GlobalContext* globalCtx, s32 arg1) {
|
||||
phi_a1 = -1;
|
||||
}
|
||||
|
||||
return (EnDoor*)func_8013A7C0(globalCtx, phi_a1);
|
||||
return SubS_FindDoor(globalCtx, phi_a1);
|
||||
}
|
||||
|
||||
s32 func_8094DFF8(EnGm* this, GlobalContext* globalCtx) {
|
||||
|
||||
@@ -953,7 +953,7 @@ Actor* func_80A13400(EnGo* this, GlobalContext* globalCtx) {
|
||||
Actor* retActor = NULL;
|
||||
|
||||
while (true) {
|
||||
actor = func_ActorCategoryIterateById(globalCtx, retActor, ACTORCAT_NPC, ACTOR_EN_GO);
|
||||
actor = SubS_FindActor(globalCtx, retActor, ACTORCAT_NPC, ACTOR_EN_GO);
|
||||
retActor = actor;
|
||||
|
||||
if ((actor != NULL) && ((EnGo*)actor != this) && (ENGO_GET_F(actor) == ENGO_F_4) &&
|
||||
|
||||
@@ -35,7 +35,7 @@ s32 func_809995A4(EnGs* this, GlobalContext* globalCtx);
|
||||
void func_80999A8C(EnGs* this, GlobalContext* globalCtx);
|
||||
void func_80999AC0(EnGs* this);
|
||||
|
||||
extern Gfx D_0407D590[];
|
||||
extern Gfx gGameplayKeepDrawFlameDL[];
|
||||
extern Gfx D_06000950[];
|
||||
extern Gfx D_060009D0[];
|
||||
extern Gfx D_06000A60[];
|
||||
@@ -363,7 +363,7 @@ void func_809984F4(EnGs* this, GlobalContext* globalCtx) {
|
||||
EnGs* gossipStone = NULL;
|
||||
|
||||
do {
|
||||
gossipStone = (EnGs*)func_ActorCategoryIterateById(globalCtx, &gossipStone->actor, ACTORCAT_PROP, ACTOR_EN_GS);
|
||||
gossipStone = (EnGs*)SubS_FindActor(globalCtx, &gossipStone->actor, ACTORCAT_PROP, ACTOR_EN_GS);
|
||||
if (gossipStone != NULL) {
|
||||
if ((this != gossipStone) && (this->unk_194 == gossipStone->unk_194)) {
|
||||
gossipStone->unk_19A |= 1;
|
||||
@@ -396,8 +396,7 @@ void func_809985B8(EnGs* this, GlobalContext* globalCtx) {
|
||||
gossipStone = NULL;
|
||||
|
||||
do {
|
||||
gossipStone =
|
||||
(EnGs*)func_ActorCategoryIterateById(globalCtx, &gossipStone->actor, ACTORCAT_PROP, ACTOR_EN_GS);
|
||||
gossipStone = (EnGs*)SubS_FindActor(globalCtx, &gossipStone->actor, ACTORCAT_PROP, ACTOR_EN_GS);
|
||||
if (gossipStone != NULL) {
|
||||
if ((gossipStone != this) && (gossipStone->actor.params == ENGS_2) &&
|
||||
(gossipStone->unk_198 == this->unk_198)) {
|
||||
@@ -1103,7 +1102,7 @@ void EnGs_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, -frames * 20, 0x20, 0x80));
|
||||
gDPSetPrimColor(POLY_XLU_DISP++, 0x80, 0x80, 255, 255, 0, 255);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, 0);
|
||||
gSPDisplayList(POLY_XLU_DISP++, D_0407D590);
|
||||
gSPDisplayList(POLY_XLU_DISP++, gGameplayKeepDrawFlameDL);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
|
||||
@@ -369,7 +369,7 @@ void func_808F38F8(EnIn* this, GlobalContext* globalCtx) {
|
||||
this->unk4A4 = NULL;
|
||||
while (true) {
|
||||
//! @bug: Infinite loop if there is only one ACTOR_EN_IN
|
||||
this->unk4A4 = (EnIn*)func_ActorCategoryIterateById(globalCtx, &this->unk4A4->actor, ACTORCAT_NPC, ACTOR_EN_IN);
|
||||
this->unk4A4 = (EnIn*)SubS_FindActor(globalCtx, &this->unk4A4->actor, ACTORCAT_NPC, ACTOR_EN_IN);
|
||||
if (this->unk4A4 != NULL && this->unk4A4 != this) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -315,7 +315,7 @@ Actor* func_80AF7CB0(EnPm* this, GlobalContext* globalCtx, u8 actorCat, s16 acto
|
||||
Actor* actor;
|
||||
|
||||
while (true) {
|
||||
actor = func_ActorCategoryIterateById(globalCtx, phi_s0, actorCat, actorId);
|
||||
actor = SubS_FindActor(globalCtx, phi_s0, actorCat, actorId);
|
||||
phi_s0 = actor;
|
||||
|
||||
if (actor == NULL) {
|
||||
@@ -338,7 +338,7 @@ Actor* func_80AF7CB0(EnPm* this, GlobalContext* globalCtx, u8 actorCat, s16 acto
|
||||
return phi_s0;
|
||||
}
|
||||
|
||||
Actor* func_80AF7D60(GlobalContext* globalCtx, s32 arg1) {
|
||||
EnDoor* func_80AF7D60(GlobalContext* globalCtx, s32 arg1) {
|
||||
s32 phi_a1;
|
||||
|
||||
switch (arg1) {
|
||||
@@ -367,7 +367,7 @@ Actor* func_80AF7D60(GlobalContext* globalCtx, s32 arg1) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return func_8013A7C0(globalCtx, phi_a1);
|
||||
return SubS_FindDoor(globalCtx, phi_a1);
|
||||
}
|
||||
|
||||
Actor* func_80AF7DC4(EnPm* this, GlobalContext* globalCtx, s32 arg2) {
|
||||
@@ -375,7 +375,7 @@ Actor* func_80AF7DC4(EnPm* this, GlobalContext* globalCtx, s32 arg2) {
|
||||
Actor* actor;
|
||||
|
||||
while (true) {
|
||||
actor = func_ActorCategoryIterateById(globalCtx, phi_s0, ACTORCAT_PROP, ACTOR_EN_PST);
|
||||
actor = SubS_FindActor(globalCtx, phi_s0, ACTORCAT_PROP, ACTOR_EN_PST);
|
||||
phi_s0 = actor;
|
||||
|
||||
if (actor == NULL) {
|
||||
@@ -942,7 +942,7 @@ s32 func_80AF8ED4(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
|
||||
s32 func_80AF9008(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* arg2) {
|
||||
u16 sp56 = gSaveContext.time - 0x3FFC;
|
||||
u8 sp55 = this->actor.params & 0xFF;
|
||||
Actor* sp50;
|
||||
EnDoor* sp50;
|
||||
Vec3s* sp4C;
|
||||
Vec3f sp40;
|
||||
Vec3f sp34;
|
||||
@@ -955,7 +955,7 @@ s32 func_80AF9008(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
|
||||
this->unk_234 = func_8013BB34(globalCtx, sp55, D_80AFB430[arg2->unk0]);
|
||||
}
|
||||
|
||||
if ((sp50 != NULL) && (sp50->update != NULL)) {
|
||||
if ((sp50 != NULL) && (sp50->actor.update != NULL)) {
|
||||
if (this->unk_234 != 0) {
|
||||
sp4C = (Vec3s*)Lib_SegmentedToVirtual(this->unk_234->points);
|
||||
Math_Vec3s_ToVec3f(&sp40, &sp4C[0]);
|
||||
@@ -964,7 +964,7 @@ s32 func_80AF9008(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
|
||||
Math_Vec3f_Copy(&this->unk_278, &sp34);
|
||||
this->actor.world.rot.y = Math_Vec3f_Yaw(&sp40, &sp34);
|
||||
Math_Vec3f_Copy(&this->actor.world.pos, &sp40);
|
||||
temp = this->actor.world.rot.y - sp50->shape.rot.y;
|
||||
temp = this->actor.world.rot.y - sp50->actor.shape.rot.y;
|
||||
if (ABS_ALT(temp) <= 0x4000) {
|
||||
this->unk_260 = -0x4B;
|
||||
} else {
|
||||
@@ -1409,7 +1409,7 @@ s32 func_80AF9BF8(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
|
||||
}
|
||||
|
||||
s32 func_80AF9D04(EnPm* this, GlobalContext* globalCtx) {
|
||||
EnDoor* sp44 = (EnDoor*)func_80AF7D60(globalCtx, this->unk_258);
|
||||
EnDoor* sp44 = func_80AF7D60(globalCtx, this->unk_258);
|
||||
Vec3f sp38;
|
||||
Vec3f* sp28;
|
||||
f32 temp;
|
||||
|
||||
@@ -689,7 +689,7 @@ s32 func_80BABDD8(EnSuttari* this, GlobalContext* globalCtx, struct_80133038_arg
|
||||
if (this->unk428 == 10 || this->unk428 == 11 || this->unk428 == 2) {
|
||||
return 0;
|
||||
}
|
||||
sp48 = (EnDoor*)func_8013BB7C(&this->actor, globalCtx, ACTORCAT_DOOR, ACTOR_EN_DOOR);
|
||||
sp48 = (EnDoor*)SubS_FindNearestActor(&this->actor, globalCtx, ACTORCAT_DOOR, ACTOR_EN_DOOR);
|
||||
sp24 = D_80BAE8F8[unkStruct->unk0];
|
||||
if ((sp48 != NULL) && (sp24 >= 0)) {
|
||||
this->unk404 = func_8013BB34(globalCtx, sp47, sp24);
|
||||
|
||||
@@ -429,7 +429,7 @@ void func_80C11338(EnThiefbird* this, GlobalContext* globalCtx) {
|
||||
this->unk_3EC = NULL;
|
||||
|
||||
do {
|
||||
item = (EnItem00*)func_ActorCategoryIterateById(globalCtx, &item->actor, ACTORCAT_MISC, ACTOR_EN_ITEM00);
|
||||
item = (EnItem00*)SubS_FindActor(globalCtx, &item->actor, ACTORCAT_MISC, ACTOR_EN_ITEM00);
|
||||
if (item != NULL) {
|
||||
if (item->unk152 > 0) {
|
||||
if (Actor_XZDistanceBetweenActors(&player->actor, &item->actor) > 10.0f) {
|
||||
|
||||
@@ -450,7 +450,7 @@ s32 func_80AECE60(EnTk* this, GlobalContext* globalCtx) {
|
||||
door1 = NULL;
|
||||
label:
|
||||
do {
|
||||
door1 = func_ActorCategoryIterateById(globalCtx, door1, ACTORCAT_DOOR, ACTOR_EN_DOOR);
|
||||
door1 = SubS_FindActor(globalCtx, door1, ACTORCAT_DOOR, ACTOR_EN_DOOR);
|
||||
if (door1 != NULL) {
|
||||
if (Actor_XZDistanceBetweenActors(&this->actor, door1) <= 120.0f) {
|
||||
if (ABS(BINANG_SUB(Actor_YawToPoint(&this->actor, &door1->world.pos), this->actor.shape.rot.y)) <=
|
||||
@@ -466,7 +466,7 @@ s32 func_80AECE60(EnTk* this, GlobalContext* globalCtx) {
|
||||
} else {
|
||||
door2 = NULL;
|
||||
do {
|
||||
door2 = func_ActorCategoryIterateById(globalCtx, door2, ACTORCAT_DOOR, ACTOR_EN_DOOR);
|
||||
door2 = SubS_FindActor(globalCtx, door2, ACTORCAT_DOOR, ACTOR_EN_DOOR);
|
||||
if (door2 != NULL) {
|
||||
if (Actor_XZDistanceBetweenActors(&this->actor, door2) <= 160.0f) {
|
||||
sp4C4 = (EnDoor*)door2;
|
||||
@@ -682,7 +682,7 @@ void func_80AED940(EnTk* this, GlobalContext* globalCtx) {
|
||||
actor = NULL;
|
||||
|
||||
do {
|
||||
actor = func_ActorCategoryIterateById(globalCtx, actor, ACTORCAT_NPC, ACTOR_EN_TK);
|
||||
actor = SubS_FindActor(globalCtx, actor, ACTORCAT_NPC, ACTOR_EN_TK);
|
||||
if (actor != NULL) {
|
||||
if (ENTK_GET_F(actor) == 1) {
|
||||
Math_Vec3f_Copy(&this->unk_2EC, &actor->world.pos);
|
||||
@@ -933,7 +933,7 @@ void func_80AEE374(EnTk* this, GlobalContext* globalCtx) {
|
||||
sp30.unk_00 = NULL;
|
||||
sp30.unk_04 = FLT_MAX;
|
||||
|
||||
func_8013E640(globalCtx, &this->actor, NULL, ACTORCAT_NPC, ACTOR_EN_TK, &sp30, func_80AEE300);
|
||||
SubS_FindActorCustom(globalCtx, &this->actor, NULL, ACTORCAT_NPC, ACTOR_EN_TK, &sp30, func_80AEE300);
|
||||
if (sp30.unk_00 == 0) {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
} else {
|
||||
@@ -971,7 +971,7 @@ void func_80AEE4D0(EnTk* this, GlobalContext* globalCtx) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 37.0f)) {
|
||||
bigPoe = NULL;
|
||||
do {
|
||||
bigPoe = func_ActorCategoryIterateById(globalCtx, bigPoe, ACTORCAT_PROP, ACTOR_EN_BIGPO);
|
||||
bigPoe = SubS_FindActor(globalCtx, bigPoe, ACTORCAT_PROP, ACTOR_EN_BIGPO);
|
||||
|
||||
if (bigPoe != NULL) {
|
||||
if ((bigPoe->params == 3) && (Actor_DistanceBetweenActors(&this->actor, bigPoe) < 80.0f)) {
|
||||
|
||||
@@ -56,7 +56,7 @@ void TGSw_ActionExecuteOneShot(TGSw* this, GlobalContext* globalCtx) {
|
||||
if (1) {}
|
||||
|
||||
do {
|
||||
actor = func_ActorCategoryIterateById(globalCtx, actor, ACTORCAT_ENEMY, ACTOR_EN_SW);
|
||||
actor = SubS_FindActor(globalCtx, actor, ACTORCAT_ENEMY, ACTOR_EN_SW);
|
||||
if (actor == NULL) {
|
||||
break;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ void TGSw_ActionExecuteOneShot(TGSw* this, GlobalContext* globalCtx) {
|
||||
actor = NULL;
|
||||
|
||||
do {
|
||||
actor = func_ActorCategoryIterateById(globalCtx, actor, ACTORCAT_NPC, ACTOR_EN_SW);
|
||||
actor = SubS_FindActor(globalCtx, actor, ACTORCAT_NPC, ACTOR_EN_SW);
|
||||
|
||||
if (actor == NULL) {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user