SubS General Pathing Helpers (#760)

* Brought code over and cleanup

* cleanup functions.h and format

* add comment

* Whitespace

* Format

* Update src/overlays/actors/ovl_En_Daiku2/z_en_daiku2.c

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>

* Format

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
This commit is contained in:
Derek Hensley 2022-03-29 13:37:58 -07:00 committed by GitHub
parent cabb14e4b7
commit 486e7cbe83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 360 additions and 172 deletions

View File

@ -0,0 +1,6 @@
<Root>
<File Name="code" OutName="sub_s" BaseAddress="0x800A5AC0" RangeStart="0x120260" RangeEnd="0x1202F0" >
<DList Name="D_801C5D60" Offset="0x1202A0"/>
<DList Name="D_801C5D80" Offset="0x1202C0"/>
</File>
</Root>

View File

@ -2439,8 +2439,8 @@ void func_8013A46C(s32 flag);
u32 func_8013A4C4(s32 flag);
s16 func_8013A504(s16 val);
s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos, Vec3s* rot, f32 distanceMin, f32 distanceMax, s16 angleError);
struct EnDoor* SubS_FindDoor(GlobalContext* globalCtx, s32 unk_1A5);
Gfx* SubS_DrawTransformFlexLimb(GlobalContext* globalCtx, s32 idx, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, TransformLimbDraw transformLimbDraw, Actor* actor, Mtx** mtx, Gfx* gfx);
struct EnDoor* SubS_FindDoor(GlobalContext* globalCtx, s32 switchFlag);
Gfx* SubS_DrawTransformFlexLimb(GlobalContext* globalCtx, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, TransformLimbDraw transformLimbDraw, Actor* actor, Mtx** mtx, Gfx* gfx);
Gfx* SubS_DrawTransformFlex(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, TransformLimbDraw transformLimbDraw, Actor* actor, Gfx* gfx);
s32 func_8013AD6C(GlobalContext* globalCtx);
s32 func_8013AD9C(s16 arg0, s16 arg1, Vec3f* arg2, Vec3s* arg3, s32 arg4, s32 arg5);
@ -2451,14 +2451,14 @@ void func_8013B0C8(s32 arg0, f32 arg1, s32 arg2, f32* arg3, f32* arg4);
void func_8013B350(Vec3f* arg0, f32* arg1, f32 arg2, s32 arg3, s32 arg4, Vec3s* arg5, f32* arg6);
s32 func_8013B6B0(Path* path, f32* arg1, s32* arg2, s32 arg3, s32 arg4, s32* arg5, f32* arg6, Vec3f* arg7, s32 arg8);
void func_8013B878(GlobalContext* globalCtx, Path* path, s32 arg2, Vec3f* arg3);
Path* func_8013BB34(GlobalContext* globalCtx, u8 arg1, s32 arg2);
Path* SubS_GetAdditionalPath(GlobalContext* globalCtx, u8 pathIndex, s32 max);
Actor* SubS_FindNearestActor(Actor* actor, GlobalContext* globalCtx, u8 actorCategory, s16 actorId);
s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animations, s32 index);
s32 func_8013BD40(Actor* actor, Path* path, s32 arg2);
Path* func_8013BEDC(GlobalContext* globalCtx, u8 arg1, u8 arg2, s32* arg3);
s32 SubS_HasReachedPoint(Actor* actor, Path* path, s32 pointIndex);
Path* SubS_GetDayDependentPath(GlobalContext* globalCtx, u8 pathIndex, u8 max, s32* startPointIndex);
s32 func_8013C068(Path* path, s32 arg1, Vec3f* arg2, f32 arg3, s32 arg4);
s32 func_8013C624(Actor* actor, Path* path, s32* arg2, f32* arg3, s32 arg4, s32 arg5);
s32 func_8013C8B8(Path* path, s32 arg1, Vec3f* arg2);
s32 SubS_CopyPointFromPathCheckBounds(Path* path, s32 pointIndex, Vec3f* dst);
s32 func_8013C964(Actor* actor, GlobalContext* globalCtx, f32 arg2, f32 arg3, s32 arg4, s32 arg5);
void func_8013CC2C(s32 arg0, s32 arg1, u8* arg2, s32 arg3);
void func_8013CD64(Vec3f* arg0, Vec3f* arg1, u8* arg2, f32 arg3, u8 arg4, u8* arg5, s8* arg6);
@ -2466,17 +2466,18 @@ void func_8013CF04(Actor* actor, GraphicsContext** gfxCtxPtr, u8* arg2);
s16 func_8013D0E0(s16* arg0, s16 arg1, s16 arg2, f32 arg3, f32 arg4, f32 arg5);
s32 func_8013D2E0(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, Vec3s* arg3, Vec3s* arg4, Vec3s* arg5, u16* arg6);
s32 SubS_AngleDiffLessEqual(s16 angleA, s16 threshold, s16 angleB);
Path* func_8013D648(GlobalContext* globalCtx, s16 arg1, s16 arg2);
s32 func_8013D68C(Path* path, s32 arg1, Vec3f* arg2);
s16 func_8013D720(Vec3f* arg0, Vec3f* arg1, f32* arg2);
s32 func_8013D768(Actor* actor, Vec3f* arg1, s16 arg2);
s16 func_8013D83C(Path* path, s32 pointIdx, Vec3f* pos, f32* distSq);
Path* SubS_GetPathByIndex(GlobalContext* globalCtx, s16 pathIndex, s16 max);
s32 SubS_CopyPointFromPath(Path* path, s32 pointIndex, Vec3f* dst);
s16 SubS_GetDistSqAndOrientPoints(Vec3f* vecA, Vec3f* vecB, f32* distSq);
s32 SubS_MoveActorToPoint(Actor* actor, Vec3f* point, s16 rotStep);
s16 SubS_GetDistSqAndOrientPath(Path* path, s32 pointIdx, Vec3f* pos, f32* distSq);
s8 SubS_IsObjectLoaded(s8 index, GlobalContext* globalCtx);
s8 SubS_GetObjectIndex(s16 id, GlobalContext* globalCtx);
Actor* SubS_FindActor(GlobalContext* globalCtx, Actor* actorListStart, u8 actorCategory, s16 actorId);
s32 SubS_FillLimbRotTables(GlobalContext* globalCtx, s16* limbRotTableY, s16* limbRotTableZ, s32 numLimbs);
s32 func_8013DB90(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2);
s32 func_8013DC40(Path* arg0, s32 arg1, s32 arg2, Vec3f* arg3);
s32 SubS_IsFloorAbove(GlobalContext* globalCtx, Vec3f* pos, f32 distAbove);
s32 SubS_CopyPointFromPathList(Path* paths, s32 pathIndex, s32 pointIndex, Vec3f* dst);
u8 SubS_GetPathCount(Path* paths, s32 index);
void SubS_ActorPathing_Init(GlobalContext* globalCtx, Vec3f* worldPos, Actor* actor, ActorPathing* actorPath, Path* paths, s32 pathIndex, s32 begPointIndex, s32 endPointIndex, s32 curPointIndex, u8 flags);
s32 SubS_ActorPathing_Update(GlobalContext* globalCtx, ActorPathing* actorPath, ActorPathingComputeFunc computePointInfoFunc, ActorPathingUpdateFunc updateActorInfoFunc, ActorPathingUpdateFunc moveFunc, ActorPathingUpdateFunc setNextPointFunc);
void SubS_ActorPathing_ComputePointInfo(GlobalContext* globalCtx, ActorPathing* actorPath);

View File

@ -10,7 +10,7 @@ typedef enum {
/* 2 */ SUBS_CUTSCENE_SET_FLAG
} SubSCutsceneType;
typedef s32 (*func_8013E748_arg6)(struct GlobalContext*, Actor*, Vec3s*);
typedef s32 (*func_8013E748_arg6)(struct GlobalContext*, Actor*, void*);
typedef s32 (*VerifyActor)(struct GlobalContext*, Actor*, Actor*, void*);

1
spec
View File

@ -530,7 +530,6 @@ beginseg
include "build/src/code/z_skin_matrix.o"
include "build/src/code/z_snap.o"
include "build/src/code/z_sub_s.o"
include "build/data/code/z_sub_s.data.o"
include "build/data/code/code_801DE890.rodata.o"
include "build/src/code/code_8013EC10.o"
include "build/data/code/code_8013EC10.bss.o"

View File

@ -152,7 +152,7 @@ s32 func_800F0CE4(EnHy* enHy, GlobalContext* globalCtx, ActorFunc draw, s16 arg3
EnDoor* door;
s32 pad;
if (func_8013D68C(enHy->path, enHy->curPoint, &enHy->actor.world.pos)) {
if (SubS_CopyPointFromPath(enHy->path, enHy->curPoint, &enHy->actor.world.pos)) {
door = EnHy_FindNearestDoor(&enHy->actor, globalCtx);
if (door != NULL) {
ret = true;
@ -174,7 +174,7 @@ s32 func_800F0DD4(EnHy* enHy, GlobalContext* globalCtx, s16 arg2, s16 arg3) {
EnDoor* door;
enHy->curPoint = 0;
if (func_8013D68C(enHy->path, enHy->curPoint, &enHy->actor.world.pos)) {
if (SubS_CopyPointFromPath(enHy->path, enHy->curPoint, &enHy->actor.world.pos)) {
door = EnHy_FindNearestDoor(&enHy->actor, globalCtx);
if (door != NULL) {
ret = true;
@ -209,7 +209,8 @@ s32 EnHy_MoveForwards(EnHy* enHy, f32 speedTarget) {
Math_SmoothStepToF(&enHy->actor.speedXZ, speedTarget, 0.4f, 1000.0f, 0.0f);
rotStep = enHy->actor.speedXZ * 400.0f;
if (func_8013D68C(enHy->path, enHy->curPoint, &curPointPos) && func_8013D768(&enHy->actor, &curPointPos, rotStep)) {
if (SubS_CopyPointFromPath(enHy->path, enHy->curPoint, &curPointPos) &&
SubS_MoveActorToPoint(&enHy->actor, &curPointPos, rotStep)) {
enHy->curPoint++;
if (enHy->curPoint >= enHy->path->count) {
reachedEnd = true;
@ -226,7 +227,8 @@ s32 EnHy_MoveBackwards(EnHy* enHy, f32 speedTarget) {
Math_SmoothStepToF(&enHy->actor.speedXZ, speedTarget, 0.4f, 1000.0f, 0.0f);
rotStep = enHy->actor.speedXZ * 400.0f;
if (func_8013D68C(enHy->path, enHy->curPoint, &curPointPos) && func_8013D768(&enHy->actor, &curPointPos, rotStep)) {
if (SubS_CopyPointFromPath(enHy->path, enHy->curPoint, &curPointPos) &&
SubS_MoveActorToPoint(&enHy->actor, &curPointPos, rotStep)) {
enHy->curPoint--;
if (enHy->curPoint < 0) {
reachedEnd = true;
@ -263,12 +265,12 @@ s32 EnHy_PlayWalkingSound(EnHy* enHy, GlobalContext* globalCtx, f32 distAboveThr
sfxId = SurfaceType_GetSfx(&globalCtx->colCtx, enHy->actor.floorPoly, enHy->actor.floorBgId) + SFX_FLAG;
}
enHy->isLeftFootOnGround = isFootOnGround = func_8013DB90(globalCtx, &enHy->leftFootPos, distAboveThreshold);
enHy->isLeftFootOnGround = isFootOnGround = SubS_IsFloorAbove(globalCtx, &enHy->leftFootPos, distAboveThreshold);
if (enHy->isLeftFootOnGround && !wasLeftFootOnGround && isFootOnGround) {
Actor_PlaySfxAtPos(&enHy->actor, sfxId);
}
enHy->isRightFootOnGround = isFootOnGround = func_8013DB90(globalCtx, &enHy->rightFootPos, distAboveThreshold);
enHy->isRightFootOnGround = isFootOnGround = SubS_IsFloorAbove(globalCtx, &enHy->rightFootPos, distAboveThreshold);
if (enHy->isRightFootOnGround && !wasRightFootOnGround && isFootOnGround) {
Actor_PlaySfxAtPos(&enHy->actor, sfxId);
}

View File

@ -6,10 +6,18 @@
#include "global.h"
#include "overlays/actors/ovl_En_Door/z_en_door.h"
s16 sPathDayFlags[] = { 0x40, 0x20, 0x10, 8, 4, 2, 1, 0 };
#include "code/sub_s/sub_s.c"
Vec3f D_801C5DB0 = { 1.0f, 1.0f, 1.0f };
s32 D_801C5DBC[] = { 0, 1 }; // Unused
/**
* Finds the first EnDoor instance with unk_1A4 == 5 and the specified unk_1A5.
* Finds the first EnDoor instance with unk_1A4 == 5 and the specified switchFlag.
*/
EnDoor* SubS_FindDoor(GlobalContext* globalCtx, s32 unk_1A5) {
EnDoor* SubS_FindDoor(GlobalContext* globalCtx, s32 switchFlag) {
Actor* actor = NULL;
EnDoor* door;
@ -21,7 +29,7 @@ EnDoor* SubS_FindDoor(GlobalContext* globalCtx, s32 unk_1A5) {
break;
}
if ((door->unk_1A4 == 5) && (door->switchFlag == (u8)unk_1A5)) {
if ((door->unk_1A4 == 5) && (door->switchFlag == (u8)switchFlag)) {
break;
}
@ -170,7 +178,21 @@ void SubS_UpdateFlags(u16* flags, u16 setBits, u16 unsetBits) {
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013B878.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013BB34.s")
Path* SubS_GetAdditionalPath(GlobalContext* globalCtx, u8 pathIndex, s32 max) {
Path* path;
s32 i = 0;
do {
path = &globalCtx->setupPathList[pathIndex];
if (i >= max) {
break;
}
pathIndex = path->unk1;
i++;
} while (pathIndex != 0xFF);
return path;
}
/**
* Finds the nearest actor instance of a specified Id and category to an actor.
@ -228,15 +250,88 @@ s32 SubS_ChangeAnimationByInfoS(SkelAnime* skelAnime, AnimationInfoS* animations
return true;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013BD40.s")
s32 SubS_HasReachedPoint(Actor* actor, Path* path, s32 pointIndex) {
Vec3s* points = Lib_SegmentedToVirtual(path->points);
s32 count = path->count;
s32 index = pointIndex;
s32 reached = false;
f32 diffX;
f32 diffZ;
f32 px;
f32 pz;
f32 d;
Vec3f point;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013BEDC.s")
Math_Vec3s_ToVec3f(&point, &points[index]);
if (index == 0) {
diffX = points[1].x - points[0].x;
diffZ = points[1].z - points[0].z;
} else if (index == count - 1) {
diffX = points[count - 1].x - points[count - 2].x;
diffZ = points[count - 1].z - points[count - 2].z;
} else {
diffX = points[index + 1].x - points[index - 1].x;
diffZ = points[index + 1].z - points[index - 1].z;
}
func_8017B7F8(&point, RADF_TO_BINANG(func_80086B30(diffX, diffZ)), &px, &pz, &d);
if (((px * actor->world.pos.x) + (pz * actor->world.pos.z) + d) > 0.0f) {
reached = true;
}
return reached;
}
Path* SubS_GetDayDependentPath(GlobalContext* globalCtx, u8 pathIndex, u8 max, s32* startPointIndex) {
Path* path = NULL;
s32 found = false;
s32 time = (((s16)TIME_TO_MINUTES_F(gSaveContext.save.time) % 60) +
((s16)TIME_TO_MINUTES_F(gSaveContext.save.time) / 60) * 60) /
30;
s32 day = CURRENT_DAY;
if (pathIndex == max) {
return NULL;
}
while (pathIndex != 0xFF) {
path = &globalCtx->setupPathList[pathIndex];
if (sPathDayFlags[day] & path->unk2) {
found = true;
break;
}
pathIndex = path->unk1;
}
if (found == true) {
*startPointIndex = time;
*startPointIndex = CLAMP(*startPointIndex, 0, path->count - 1);
} else {
*startPointIndex = 0;
}
return path;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013C068.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013C624.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013C8B8.s")
s32 SubS_CopyPointFromPathCheckBounds(Path* path, s32 pointIndex, Vec3f* dst) {
Vec3s* point;
if ((path == NULL) || (pointIndex >= path->count) || (pointIndex < 0)) {
return false;
}
point = Lib_SegmentedToVirtual(path->points);
point = &point[pointIndex];
dst->x = point->x;
dst->y = point->y;
dst->z = point->z;
return true;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013C964.s")
@ -254,15 +349,68 @@ s32 SubS_AngleDiffLessEqual(s16 angleA, s16 threshold, s16 angleB) {
return (ABS_ALT(BINANG_SUB(angleB, angleA)) <= threshold) ? true : false;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D648.s")
Path* SubS_GetPathByIndex(GlobalContext* globalCtx, s16 pathIndex, s16 max) {
return (pathIndex != max) ? &globalCtx->setupPathList[pathIndex] : NULL;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D68C.s")
s32 SubS_CopyPointFromPath(Path* path, s32 pointIndex, Vec3f* dst) {
Vec3s* point;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D720.s")
if (path == NULL) {
return false;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D768.s")
point = Lib_SegmentedToVirtual(path->points);
point = &point[pointIndex];
dst->x = point->x;
dst->y = point->y;
dst->z = point->z;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013D83C.s")
return true;
}
s16 SubS_GetDistSqAndOrientPoints(Vec3f* vecA, Vec3f* vecB, f32* distSq) {
f32 diffX = vecA->x - vecB->x;
f32 diffZ = vecA->z - vecB->z;
*distSq = SQ(diffX) + SQ(diffZ);
return Math_Atan2S(diffX, diffZ);
}
/**
* Returns true when the actor has reached the inputed point
*/
s32 SubS_MoveActorToPoint(Actor* actor, Vec3f* point, s16 rotStep) {
Vec3f offsetBefore;
Vec3f offsetAfter;
f32 distSqBefore;
f32 distSqAfter;
Actor_OffsetOfPointInActorCoords(actor, &offsetBefore, point);
Math_SmoothStepToS(&actor->world.rot.y, SubS_GetDistSqAndOrientPoints(point, &actor->world.pos, &distSqBefore), 4,
rotStep, 1);
actor->shape.rot.y = actor->world.rot.y;
Actor_MoveWithGravity(actor);
Actor_OffsetOfPointInActorCoords(actor, &offsetAfter, point);
SubS_GetDistSqAndOrientPoints(point, &actor->world.pos, &distSqAfter);
return ((offsetBefore.z > 0.0f) && (offsetAfter.z <= 0.0f)) ? true : false;
}
s16 SubS_GetDistSqAndOrientPath(Path* path, s32 pointIndex, Vec3f* pos, f32* distSq) {
Vec3s* point;
f32 diffX = 0.0f;
f32 diffZ = 0.0f;
if (path != NULL) {
point = Lib_SegmentedToVirtual(path->points);
point = &point[pointIndex];
diffX = point->x - pos->x;
diffZ = point->z - pos->z;
}
*distSq = SQ(diffX) + SQ(diffZ);
return Math_Atan2S(diffX, diffZ);
}
s8 SubS_IsObjectLoaded(s8 index, GlobalContext* globalCtx) {
return !Object_IsLoaded(&globalCtx->objectCtx, index) ? false : true;
@ -301,11 +449,35 @@ s32 SubS_FillLimbRotTables(GlobalContext* globalCtx, s16* limbRotTableY, s16* li
return true;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013DB90.s")
s32 SubS_IsFloorAbove(GlobalContext* globalCtx, Vec3f* pos, f32 distAbove) {
CollisionPoly* outPoly;
Vec3f posA;
Vec3f posB;
Vec3f posResult;
s32 bgId;
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013DC40.s")
posA = posB = *pos;
posB.y += distAbove;
return BgCheck_EntityLineTest1(&globalCtx->colCtx, &posA, &posB, &posResult, &outPoly, false, true, false, true,
&bgId);
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_sub_s/func_8013DCCC.s")
s32 SubS_CopyPointFromPathList(Path* paths, s32 pathIndex, s32 pointIndex, Vec3f* dst) {
Path* path = &paths[pathIndex];
Vec3s* point = &((Vec3s*)Lib_SegmentedToVirtual(path->points))[pointIndex];
dst->x = point->x;
dst->y = point->y;
dst->z = point->z;
return false;
}
u8 SubS_GetPathCount(Path* paths, s32 index) {
Path* path = &paths[index];
return path->count;
}
void SubS_ActorPathing_Init(GlobalContext* globalCtx, Vec3f* worldPos, Actor* actor, ActorPathing* actorPath,
Path* paths, s32 pathIndex, s32 begPointIndex, s32 endPointIndex, s32 curPointIndex,

View File

@ -328,7 +328,7 @@ void BgIngate_Init(Actor* thisx, GlobalContext* globalCtx2) {
this->unk160 |= 0x8;
this->unk160 |= 0x10;
Actor_SetScale(&this->dyna.actor, 1.0f);
this->unk164 = func_8013BB34(globalCtx, BGINGATE_GET_FF(&this->dyna.actor), 0);
this->unk164 = SubS_GetAdditionalPath(globalCtx, BGINGATE_GET_FF(&this->dyna.actor), 0);
this->dyna.actor.room = -1;
if (gSaveContext.save.weekEventReg[20] & 2) {
gSaveContext.save.weekEventReg[90] &= (u8)~0x40;
@ -350,7 +350,7 @@ void BgIngate_Init(Actor* thisx, GlobalContext* globalCtx2) {
this->actionFunc = func_80953F8C;
}
}
this->unk164 = func_8013BB34(globalCtx, BGINGATE_GET_FF(&this->dyna.actor), phi_a2);
this->unk164 = SubS_GetAdditionalPath(globalCtx, BGINGATE_GET_FF(&this->dyna.actor), phi_a2);
if (this->unk164 != 0) {
sp38 = Lib_SegmentedToVirtual(this->unk164->points);
Math_Vec3s_ToVec3f(&sp2C, &sp38[0]);
@ -361,7 +361,7 @@ void BgIngate_Init(Actor* thisx, GlobalContext* globalCtx2) {
this->dyna.actor.world.pos.y = -15.0f;
this->dyna.actor.world.pos.z = sp2C.z;
}
this->unk164 = func_8013BB34(globalCtx, BGINGATE_GET_FF(&this->dyna.actor), 0);
this->unk164 = SubS_GetAdditionalPath(globalCtx, BGINGATE_GET_FF(&this->dyna.actor), 0);
} else {
Actor_MarkForDeath(&this->dyna.actor);
}

View File

@ -1606,7 +1606,7 @@ void EnAkindonuts_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actor.gravity = -1.0f;
if (!ENAKINDONUTS_GET_4(&this->actor)) {
this->path = func_8013D648(globalCtx, ENAKINDONUTS_GET_FC00(&this->actor), 0x3F);
this->path = SubS_GetPathByIndex(globalCtx, ENAKINDONUTS_GET_FC00(&this->actor), 0x3F);
if (this->path == NULL) {
Actor_MarkForDeath(&this->actor);
return;

View File

@ -113,7 +113,7 @@ void func_809C1158(EnAob01* this, GlobalContext* globalCtx) {
if (temp_s0 != 0x3F) {
do {
this->unk_1D8[i] = func_8013D648(globalCtx, temp_s0, 0x3F);
this->unk_1D8[i] = SubS_GetPathByIndex(globalCtx, temp_s0, 0x3F);
temp_s0 = this->unk_1D8[i]->unk1;
i++;
} while (temp_s0 != 0xFF);

View File

@ -266,7 +266,7 @@ s32 func_80BA8D2C(EnBaba* this, f32 arg1) {
Math_SmoothStepToF(&this->actor.speedXZ, arg1, 0.4f, 1000.0f, 0.0f);
sp3E = this->actor.speedXZ * 400.0f;
if (func_8013D68C(this->path, this->unk_1E8, &sp2C) && func_8013D768(&this->actor, &sp2C, sp3E)) {
if (SubS_CopyPointFromPath(this->path, this->unk_1E8, &sp2C) && SubS_MoveActorToPoint(&this->actor, &sp2C, sp3E)) {
this->unk_1E8++;
if (this->unk_1E8 >= this->path->count) {
ret = true;
@ -311,7 +311,7 @@ s32 func_80BA8F88(EnBaba* this, GlobalContext* globalCtx, struct_80133038_arg2*
u8 sp23 = ENBABA_GET_3F00(&this->actor);
if (D_80BAA4A8[arg2->unk0] >= 0) {
this->unk_410 = func_8013BB34(globalCtx, sp23, D_80BAA4A8[arg2->unk0]);
this->unk_410 = SubS_GetAdditionalPath(globalCtx, sp23, D_80BAA4A8[arg2->unk0]);
}
if (this->unk_410 == NULL) {
@ -659,7 +659,7 @@ void EnBaba_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
this->path = func_8013D648(globalCtx, ENBABA_GET_3F00(&this->actor), ENBABA_3F00_3F);
this->path = SubS_GetPathByIndex(globalCtx, ENBABA_GET_3F00(&this->actor), ENBABA_3F00_3F);
Actor_SetScale(&this->actor, 0.01f);

View File

@ -220,7 +220,7 @@ void EnBba01_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetCylinder(globalCtx, &this->enHy.collider, &this->enHy.actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->enHy.actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
this->enHy.actor.flags &= ~ACTOR_FLAG_1;
this->enHy.path = func_8013D648(globalCtx, ENBBA01_GET_PATH(&this->enHy.actor), ENBBA01_NO_PATH);
this->enHy.path = SubS_GetPathByIndex(globalCtx, ENBBA01_GET_PATH(&this->enHy.actor), ENBBA01_NO_PATH);
this->enHy.waitingOnInit = true;
Actor_SetScale(&this->enHy.actor, 0.01f);
this->enHy.actionFunc = EnBba01_FinishInit;

View File

@ -94,7 +94,7 @@ void EnBomBowlMan_Init(Actor* thisx, GlobalContext* globalCtx) {
}
this->unk_29A = ENBOMBOWLMAN_GET_FF00(&this->actor);
this->path = func_8013D648(globalCtx, this->unk_29A, 0x3F);
this->path = SubS_GetPathByIndex(globalCtx, this->unk_29A, 0x3F);
this->unk_2C8 = 80.0f;
if ((gSaveContext.save.entranceIndex == 0xD220) && (gSaveContext.save.weekEventReg[73] & 0x80) &&
@ -157,7 +157,7 @@ void func_809C4B50(EnBomBowlMan* this) {
void func_809C4B6C(EnBomBowlMan* this) {
if ((this->unk_29A != ENBOMBOWLMAN_FF00_MINUS1) && (this->path != NULL)) {
if (!func_8013D68C(this->path, this->unk_298, &this->unk_2A0)) {
if (!SubS_CopyPointFromPath(this->path, this->unk_298, &this->unk_2A0)) {
Actor_MarkForDeath(&this->actor);
}
}

View File

@ -210,7 +210,7 @@ void EnCne01_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetCylinder(globalCtx, &this->enHy.collider, &this->enHy.actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->enHy.actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
this->enHy.actor.flags &= ~ACTOR_FLAG_1;
this->enHy.path = func_8013D648(globalCtx, ENCNE01_GET_PATH(&this->enHy.actor), ENCNE01_NO_PATH);
this->enHy.path = SubS_GetPathByIndex(globalCtx, ENCNE01_GET_PATH(&this->enHy.actor), ENCNE01_NO_PATH);
this->enHy.waitingOnInit = true;
Actor_SetScale(&this->enHy.actor, 0.01f);
this->enHy.actionFunc = EnCne01_FinishInit;

View File

@ -67,7 +67,7 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_278 = ENDAIKU_GET_FF(&this->actor);
if (this->unk_278 == ENDAIKU_PARAMS_FF_3) {
this->unk_288 = ENDAIKU_GET_FF00(&this->actor);
this->unk_258 = func_8013D648(globalCtx, this->unk_288, 0x3F);
this->unk_258 = SubS_GetPathByIndex(globalCtx, this->unk_288, 0x3F);
} else if (this->unk_278 == ENDAIKU_PARAMS_FF_2) {
this->unk_264 = -2000;
}
@ -134,7 +134,7 @@ void func_8094373C(EnDaiku* this, s32 arg1) {
void func_809437C8(EnDaiku* this) {
if ((this->unk_288 != -1) && (this->unk_258 != 0)) {
if (!func_8013D68C(this->unk_258, this->unk_25C, &this->unk_26C)) {
if (!SubS_CopyPointFromPath(this->unk_258, this->unk_25C, &this->unk_26C)) {
Actor_MarkForDeath(&this->actor);
}
}

View File

@ -70,7 +70,7 @@ static ColliderCylinderInit sCylinderInit = {
void func_80BE61D0(EnDaiku2* this) {
if ((this->unk_27A != -1) && (this->unk_258 != 0)) {
if (func_8013D68C(this->unk_258, this->unk_25C, &this->unk_268) == 0) {
if (!SubS_CopyPointFromPath(this->unk_258, this->unk_25C, &this->unk_268)) {
Actor_MarkForDeath(&this->actor);
}
}
@ -88,7 +88,7 @@ void EnDaiku2_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitAndSetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
this->unk_278 = ENDAIKU2_GET_7F(&this->actor);
this->unk_27A = ENDAIKU2_GET_1F80(&this->actor);
this->unk_258 = func_8013D648(globalCtx, this->unk_27A, 0x3F);
this->unk_258 = SubS_GetPathByIndex(globalCtx, this->unk_27A, 0x3F);
this->unk_280 = ENDAIKU2_GET_8000(&this->actor);
Actor_SetScale(&this->actor, 0.01f);
if (!this->unk_280) {

View File

@ -212,7 +212,7 @@ s32 func_80989418(EnDg* this, Path* arg1, s32 arg2) {
if (idx == 0) {
phi_f12 = sp5C[1].x - sp5C[0].x;
phi_f14 = sp5C[1].z - sp5C[0].z;
} else if ((idx + 1) == ((void)0, count)) {
} else if (idx == count - 1) {
phi_f12 = sp5C[count - 1].x - sp5C[count - 2].x;
phi_f14 = sp5C[count - 1].z - sp5C[count - 2].z;
} else {
@ -220,7 +220,7 @@ s32 func_80989418(EnDg* this, Path* arg1, s32 arg2) {
phi_f14 = sp5C[idx + 1].z - sp5C[idx - 1].z;
}
func_8017B7F8(&sp30, func_80086B30(phi_f12, phi_f14) * 10430.378f, &sp44, &sp40, &sp3C);
func_8017B7F8(&sp30, RADF_TO_BINANG(func_80086B30(phi_f12, phi_f14)), &sp44, &sp40, &sp3C);
if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
sp50 = true;
}
@ -1114,7 +1114,7 @@ void EnDg_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
Actor_ProcessInitChain(&this->actor, sInitChain);
this->unk_1DC = func_8013D648(globalCtx, ENDG_GET_FC00(&this->actor), 0x3F);
this->unk_1DC = SubS_GetPathByIndex(globalCtx, ENDG_GET_FC00(&this->actor), 0x3F);
Actor_SetScale(&this->actor, 0.0075f);
this->actor.targetMode = 1;
this->actor.gravity = -3.0f;

View File

@ -369,7 +369,7 @@ void EnGg2_Init(Actor* thisx, GlobalContext* globalCtx2) {
this->actor.bgCheckFlags |= 0x400;
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &object_gg_Skel_00F6C0, &object_gg_Anim_00F578, this->jointTable,
this->morphTable, 20);
this->unk_1D8 = func_8013D648(globalCtx, ENGG2_GET_FC00(&this->actor), 0x3F);
this->unk_1D8 = SubS_GetPathByIndex(globalCtx, ENGG2_GET_FC00(&this->actor), 0x3F);
this->actor.flags &= ~ACTOR_FLAG_80;
this->unk_2F0 = 0;
this->unk_2F1 = 0;

View File

@ -1028,7 +1028,7 @@ void EnGk_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_MarkForDeath(&this->actor);
} else {
this->unk_318 = this->actor.cutscene;
this->path = func_8013D648(globalCtx, ENGK_GET_F0(&this->actor), 15);
this->path = SubS_GetPathByIndex(globalCtx, ENGK_GET_F0(&this->actor), 15);
this->actionFunc = func_80B51760;
}
} else if (globalCtx->sceneNum == SCENE_GORONRACE) {

View File

@ -902,7 +902,7 @@ s32 func_8094F7D0(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
actor = func_8094DEE0(this, globalCtx, arg3, arg4);
if (D_80951A0C[arg2->unk0] >= 0) {
this->unk_234 = func_8013BB34(globalCtx, sp4F, D_80951A0C[arg2->unk0]);
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp4F, D_80951A0C[arg2->unk0]);
}
if ((actor != NULL) && (actor->update != NULL)) {
@ -933,7 +933,7 @@ s32 func_8094F904(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
door = func_8094DF90(globalCtx, arg2->unk0);
if (D_80951A0C[arg2->unk0] >= 0) {
this->unk_234 = func_8013BB34(globalCtx, sp55, D_80951A0C[arg2->unk0]);
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp55, D_80951A0C[arg2->unk0]);
}
if ((door != NULL) && (door->dyna.actor.update != NULL)) {
@ -974,7 +974,7 @@ s32 func_8094FAC4(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_234 = NULL;
if (D_80951A0C[arg2->unk0] >= 0) {
this->unk_234 = func_8013BB34(globalCtx, sp2B, D_80951A0C[arg2->unk0]);
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp2B, D_80951A0C[arg2->unk0]);
}
if ((this->unk_234 != NULL) && (this->unk_234->count < 3)) {
@ -1076,7 +1076,7 @@ s32 func_8094FF04(EnGm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_234 = NULL;
if (D_80951A0C[arg2->unk0] >= 0) {
this->unk_234 = func_8013BB34(globalCtx, sp4F, D_80951A0C[arg2->unk0]);
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp4F, D_80951A0C[arg2->unk0]);
}
if (this->unk_234 != NULL) {

View File

@ -1332,7 +1332,7 @@ void func_80A1428C(EnGo* this, GlobalContext* globalCtx) {
Math_Vec3f_Copy(&sp30, &this->actor.world.pos);
if (this->unk_284 != NULL) {
this->actor.flags &= ~ACTOR_FLAG_2000000;
func_8013C8B8(this->unk_284, 0, &sp24);
SubS_CopyPointFromPathCheckBounds(this->unk_284, 0, &sp24);
temp = Math_Vec3f_Yaw(&sp30, &sp24);
this->actor.shape.rot.y = temp;
this->actor.world.rot.y = temp;
@ -1393,7 +1393,7 @@ void func_80A1449C(EnGo* this, GlobalContext* globalCtx) {
void func_80A144F4(EnGo* this, GlobalContext* globalCtx) {
if (gSaveContext.save.day >= 2) {
this->unk_284 = func_8013BEDC(globalCtx, ENGO_GET_7F80(&this->actor), 0xFF, &this->unk_3E4);
this->unk_284 = SubS_GetDayDependentPath(globalCtx, ENGO_GET_7F80(&this->actor), 0xFF, &this->unk_3E4);
if (this->unk_284 != NULL) {
this->unk_3E4 = 1;
}
@ -1785,7 +1785,7 @@ void func_80A153FC(EnGo* this, GlobalContext* globalCtx) {
}
sp5C = Lib_SegmentedToVirtual(this->unk_284->points);
if (func_8013BD40(&this->actor, this->unk_284, this->unk_3E4)) {
if (SubS_HasReachedPoint(&this->actor, this->unk_284, this->unk_3E4)) {
if (this->unk_3E4 >= (this->unk_284->count - 1)) {
this->unk_3E4 = 0;
} else {

View File

@ -103,7 +103,7 @@ void EnHiddenNuts_Init(Actor* thisx, GlobalContext* globalCtx) {
return;
}
this->path = func_8013D648(globalCtx, this->unk_21E, 0x3F);
this->path = SubS_GetPathByIndex(globalCtx, this->unk_21E, 0x3F);
this->unk_226 = this->actor.cutscene;
func_801A5080(2);
func_80BDB268(this);
@ -311,7 +311,7 @@ void func_80BDBA28(EnHiddenNuts* this, GlobalContext* globalCtx) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_EN_NUTS_UP);
this->unk_208 = 1;
if ((this->path != NULL) && !func_8013D68C(this->path, this->unk_208, &this->unk_20C)) {
if ((this->path != NULL) && !SubS_CopyPointFromPath(this->path, this->unk_208, &this->unk_20C)) {
Actor_MarkForDeath(&this->actor);
}
@ -376,7 +376,7 @@ void func_80BDBB48(EnHiddenNuts* this, GlobalContext* globalCtx) {
this->unk_208++;
if (this->unk_208 >= this->path->count) {
func_80BDBE70(this, globalCtx);
} else if ((this->path != NULL) && !func_8013D68C(this->path, this->unk_208, &this->unk_20C)) {
} else if ((this->path != NULL) && !SubS_CopyPointFromPath(this->path, this->unk_208, &this->unk_20C)) {
Actor_MarkForDeath(&this->actor);
}
}

View File

@ -478,7 +478,7 @@ s32 func_80BF1C44(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_274 = NULL;
if (D_80BF3318[arg2->unk0] >= 0) {
this->unk_274 = func_8013BB34(globalCtx, sp4F, D_80BF3318[arg2->unk0]);
this->unk_274 = SubS_GetAdditionalPath(globalCtx, sp4F, D_80BF3318[arg2->unk0]);
}
if ((sp2C != NULL) && (sp2C->update != NULL)) {
@ -522,7 +522,7 @@ s32 func_80BF1DF4(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
door = func_80BF1200(globalCtx, arg2->unk0);
if (D_80BF3318[arg2->unk0] >= 0) {
this->unk_274 = func_8013BB34(globalCtx, sp55, D_80BF3318[arg2->unk0]);
this->unk_274 = SubS_GetAdditionalPath(globalCtx, sp55, D_80BF3318[arg2->unk0]);
}
if ((door != NULL) && (door->dyna.actor.update != NULL)) {
@ -563,7 +563,7 @@ s32 func_80BF1FA8(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_274 = NULL;
if (D_80BF3318[arg2->unk0] >= 0) {
this->unk_274 = func_8013BB34(globalCtx, sp2B, D_80BF3318[arg2->unk0]);
this->unk_274 = SubS_GetAdditionalPath(globalCtx, sp2B, D_80BF3318[arg2->unk0]);
}
if ((this->unk_274 != NULL) && (this->unk_274->count < 3)) {
@ -613,7 +613,7 @@ s32 func_80BF219C(EnIg* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_274 = NULL;
if (D_80BF3318[arg2->unk0] >= 0) {
this->unk_274 = func_8013BB34(globalCtx, sp4F, D_80BF3318[arg2->unk0]);
this->unk_274 = SubS_GetAdditionalPath(globalCtx, sp4F, D_80BF3318[arg2->unk0]);
}
if ((this->unk_274 != 0) && (this->unk_274->count >= 2)) {

View File

@ -165,11 +165,11 @@ s32 func_808F3178(EnIn* this, GlobalContext* globalCtx) {
u8 prevUnk261 = this->unk261;
u8 tmp;
this->unk260 = tmp = func_8013DB90(globalCtx, &this->unk248, -6.0f);
this->unk260 = tmp = SubS_IsFloorAbove(globalCtx, &this->unk248, -6.0f);
if (this->unk260 != 0 && prevUnk260 == 0 && tmp) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_CONCRETE);
}
this->unk261 = tmp = func_8013DB90(globalCtx, &this->unk254, -6.0f);
this->unk261 = tmp = SubS_IsFloorAbove(globalCtx, &this->unk254, -6.0f);
if (this->unk261 != 0 && prevUnk261 == 0 && tmp) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_PL_WALK_CONCRETE);
}
@ -286,7 +286,7 @@ void func_808F3690(EnIn* this, GlobalContext* globalCtx) {
Math_SmoothStepToF(&this->actor.speedXZ, 1.0f, 0.4f, 1000.0f, 0.0f);
sp36 = this->actor.speedXZ * 400.0f;
if (func_8013D68C(this->path, this->unk244, &sp28) && func_8013D768(&this->actor, &sp28, sp36)) {
if (SubS_CopyPointFromPath(this->path, this->unk244, &sp28) && SubS_MoveActorToPoint(&this->actor, &sp28, sp36)) {
this->unk244++;
if (this->unk244 >= this->path->count) {
this->unk244 = 0;
@ -1382,7 +1382,7 @@ void EnIn_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetJntSph(globalCtx, &this->colliderJntSph, &this->actor, &sJntSphInit, &this->colliderJntSphElement);
Actor_SetScale(&this->actor, 0.01f);
this->actor.gravity = -4.0f;
this->path = func_8013D648(globalCtx, ENIN_GET_PATH(&this->actor), 0x3F);
this->path = SubS_GetPathByIndex(globalCtx, ENIN_GET_PATH(&this->actor), 0x3F);
this->unk23D = 0;
if (type == ENIN_YELLOW_SHIRT || type == ENIN_BLUE_SHIRT) {
if (GET_RACE_FLAGS == RACE_FLAG_2 || (GET_RACE_FLAGS) == RACE_FLAG_3) {

View File

@ -957,7 +957,7 @@ void EnJg_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc = EnJg_LullabyIntroCutsceneAction;
} else {
// This is the elder that appears in Mountain Village or the Path to Goron Village in winter.
this->path = func_8013D648(globalCtx, EN_JG_GET_PATH(thisx), 0x3F);
this->path = SubS_GetPathByIndex(globalCtx, EN_JG_GET_PATH(thisx), 0x3F);
this->animationIndex = EN_JG_ANIMATION_SURPRISE_START;
this->action = EN_JG_ACTION_SPAWNING;
this->freezeTimer = 1000;

View File

@ -164,9 +164,9 @@ void EnLookNuts_Patrol(EnLookNuts* this, GlobalContext* globalCtx) {
return;
}
this->path = func_8013D648(globalCtx, this->pathLocation, 0x1F);
this->path = SubS_GetPathByIndex(globalCtx, this->pathLocation, 0x1F);
if (this->path != NULL) {
sp34 = func_8013D83C(this->path, this->currentPathIndex, &this->actor.world.pos, &sp30);
sp34 = SubS_GetDistSqAndOrientPath(this->path, this->currentPathIndex, &this->actor.world.pos, &sp30);
}
if (sp30 < 10.0f) {

View File

@ -916,7 +916,7 @@ s32 func_80AF8ED4(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_234 = NULL;
sp2C = func_80AF7CB0(this, globalCtx, actorCat, actorId);
if (D_80AFB430[arg2->unk0] >= 0) {
this->unk_234 = func_8013BB34(globalCtx, sp4F, D_80AFB430[arg2->unk0]);
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp4F, D_80AFB430[arg2->unk0]);
}
if ((sp2C != NULL) && (sp2C->update != NULL)) {
@ -947,7 +947,7 @@ s32 func_80AF9008(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_234 = NULL;
door = func_80AF7D60(globalCtx, arg2->unk0);
if (D_80AFB430[arg2->unk0] >= 0) {
this->unk_234 = func_8013BB34(globalCtx, sp55, D_80AFB430[arg2->unk0]);
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp55, D_80AFB430[arg2->unk0]);
}
if ((door != NULL) && (door->dyna.actor.update != NULL)) {
@ -992,7 +992,7 @@ s32 func_80AF91E8(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_234 = NULL;
if (D_80AFB430[arg2->unk0] >= 0) {
this->unk_234 = func_8013BB34(globalCtx, sp2B, D_80AFB430[arg2->unk0]);
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp2B, D_80AFB430[arg2->unk0]);
}
if ((this->unk_234 != NULL) && (this->unk_234->count < 3)) {
@ -1072,7 +1072,7 @@ s32 func_80AF94AC(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_234 = NULL;
if (D_80AFB430[arg2->unk0] >= 0) {
this->unk_234 = func_8013BB34(globalCtx, sp4F, D_80AFB430[arg2->unk0]);
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp4F, D_80AFB430[arg2->unk0]);
}
if ((this->unk_234 != 0) && (this->unk_234->count >= 2)) {
@ -1125,7 +1125,7 @@ s32 func_80AF95E8(EnPm* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
this->unk_234 = NULL;
phi_a3 = D_80AFB430[arg2->unk0];
if (phi_a3 >= 0) {
this->unk_234 = func_8013BB34(globalCtx, sp4F, phi_a3);
this->unk_234 = SubS_GetAdditionalPath(globalCtx, sp4F, phi_a3);
}
if ((this->unk_234 != 0) && (this->unk_234->count >= 2)) {

View File

@ -152,7 +152,7 @@ void EnPr2_Init(Actor* thisx, GlobalContext* globalCtx) {
if (parent->update != NULL) {
this->unk_1C8 = ((EnEncount1*)parent)->unk_15A;
this->path = func_8013D648(globalCtx, this->unk_1C8, 0x3F);
this->path = SubS_GetPathByIndex(globalCtx, this->unk_1C8, 0x3F);
this->unk_208 = parent->world.rot.z * 20.0f;
if (this->unk_208 < 20.0f) {
this->unk_208 = 20.0f;
@ -276,7 +276,7 @@ void func_80A745FC(EnPr2* this, GlobalContext* globalCtx) {
Math_ApproachF(&this->actor.speedXZ, 10.0f, 0.3f, 1.0f);
}
if ((this->path != NULL) && !func_8013D68C(this->path, this->unk_1D0, &this->unk_21C)) {
if ((this->path != NULL) && !SubS_CopyPointFromPath(this->path, this->unk_1D0, &this->unk_21C)) {
Actor_MarkForDeath(&this->actor);
}

View File

@ -225,7 +225,7 @@ void EnRacedog_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
Actor_ProcessInitChain(&this->actor, sInitChain);
this->unk_1E0 = func_8013D648(globalCtx, ENRACEDOG_GET_PATH(&this->actor), 0x3F);
this->unk_1E0 = SubS_GetPathByIndex(globalCtx, ENRACEDOG_GET_PATH(&this->actor), 0x3F);
Actor_SetScale(&this->actor, 0.0075f);
this->actor.gravity = -3.0f;
if (ENRACEDOG_GET_3E0(&this->actor) < 14) {

View File

@ -383,8 +383,8 @@ s32 func_80BF43FC(EnRg* this) {
s32 phi_s0 = D_80BF57E4[this->unk_344][temp_s7];
while (true) {
func_8013C8B8(this->path, phi_s0 - 1, &sp9C);
func_8013C8B8(this->path, phi_s0 + 1, &sp90);
SubS_CopyPointFromPathCheckBounds(this->path, phi_s0 - 1, &sp9C);
SubS_CopyPointFromPathCheckBounds(this->path, phi_s0 + 1, &sp90);
if (Math3D_PointDistToLine2D(this->actor.world.pos.x, this->actor.world.pos.z, sp9C.x, sp9C.z, sp90.x, sp90.z,
&sp8C, &sp88, &sp84) &&
(!phi_s6 || ((phi_s4 + 1) == phi_s0) || (sp84 < phi_f20))) {
@ -521,7 +521,7 @@ void func_80BF4964(EnRg* this) {
if (this->path != NULL) {
sp3C = Lib_SegmentedToVirtual(this->path->points);
if (func_8013BD40(&this->actor, this->path, this->unk_33C)) {
if (SubS_HasReachedPoint(&this->actor, this->path, this->unk_33C)) {
if ((this->path->count - 1) < (this->unk_33C + 1)) {
this->unk_33C = this->path->count - 1;
} else {
@ -749,7 +749,7 @@ void EnRg_Init(Actor* thisx, GlobalContext* globalCtx) {
Effect_Add(globalCtx, &this->unk_340, EFFECT_TIRE_MARK, 0, 0, &D_80BF59F0);
this->path = func_8013BEDC(globalCtx, ENRG_GET_7F80(&this->actor), 255, &this->unk_33C);
this->path = SubS_GetDayDependentPath(globalCtx, ENRG_GET_7F80(&this->actor), 255, &this->unk_33C);
if (this->path != NULL) {
this->unk_33C = 1;
}

View File

@ -639,7 +639,7 @@ void EnRuppecrow_Init(Actor* thisx, GlobalContext* globalCtx2) {
Actor_SetScale(&this->actor, 0.01f);
this->actor.flags |= ACTOR_FLAG_2000000;
this->path = func_8013D648(globalCtx, ENRUPPECROW_GET_PATH(&this->actor), 0x3F);
this->path = SubS_GetPathByIndex(globalCtx, ENRUPPECROW_GET_PATH(&this->actor), 0x3F);
if (this->path != NULL) {
this->actionFunc = EnRuppecrow_HandleSong;
} else {

View File

@ -708,7 +708,7 @@ void EnScopenuts_Init(Actor* thisx, GlobalContext* globalCtx) {
if (gSaveContext.save.weekEventReg[52] & 0x40) {
Actor_MarkForDeath(&this->actor);
} else if (globalCtx->actorCtx.unk5 & 2) {
this->path = func_8013D648(globalCtx, ENSCOPENUTS_GET_FC00(&this->actor), 0x3F);
this->path = SubS_GetPathByIndex(globalCtx, ENSCOPENUTS_GET_FC00(&this->actor), 0x3F);
this->actor.draw = NULL;
this->actionFunc = func_80BCAFA8;
this->actor.gravity = 0.0f;
@ -717,7 +717,7 @@ void EnScopenuts_Init(Actor* thisx, GlobalContext* globalCtx) {
}
} else if (ENSCOPENUTS_GET_3E0(&this->actor) == ENSCOPENUTS_3E0_1) {
if (gSaveContext.save.weekEventReg[52] & 0x40) {
this->path = func_8013D648(globalCtx, ENSCOPENUTS_GET_FC00(&this->actor), 0x3F);
this->path = SubS_GetPathByIndex(globalCtx, ENSCOPENUTS_GET_FC00(&this->actor), 0x3F);
if (this->path == NULL) {
Actor_MarkForDeath(&this->actor);
} else {

View File

@ -915,7 +915,7 @@ s32 func_80ADCE4C(EnSellnuts* this, Path* path, s32 arg2) {
pointY = points[var + 1].z - points[var - 1].z;
}
func_8017B7F8(&sp30, func_80086B30(pointX, pointY) * 10430.378f, &sp44, &sp40, &sp3C);
func_8017B7F8(&sp30, RADF_TO_BINANG(func_80086B30(pointX, pointY)), &sp44, &sp40, &sp3C);
if (((this->actor.world.pos.x * sp44) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
ret = true;
}
@ -957,7 +957,7 @@ void EnSellnuts_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinderType1(globalCtx, &this->collider, &this->actor, &sCylinderInit);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 35.0f);
this->path = func_8013D648(globalCtx, ENSELLNUTS_GET_FC00(&this->actor), 0x3F);
this->path = SubS_GetPathByIndex(globalCtx, ENSELLNUTS_GET_FC00(&this->actor), 0x3F);
this->cutscene = this->actor.cutscene;
Actor_SetScale(&this->actor, 0.01f);
this->actor.colChkInfo.cylRadius = 0;

View File

@ -53,7 +53,7 @@ void EnSob1_Blink(EnSob1* this);
s32 EnSob1_TakeItemOffShelf(EnSob1* this);
s32 EnSob1_ReturnItemToShelf(EnSob1* this);
s16 EnSob1_GetXZAngleAndDistanceSqToPoint(Path* path, s32 pointIdx, Vec3f* pos, f32* distSq);
s16 EnSob1_GetDistSqAndOrient(Path* path, s32 pointIdx, Vec3f* pos, f32* distSq);
static AnimationInfoS sAnimationsBombShopkeeper[] = {
{ &object_rs_Anim_009120, 2.0f, 0, -1, ANIMMODE_LOOP, 20 },
@ -711,10 +711,9 @@ void EnSob1_EndWalk(EnSob1* this, GlobalContext* globalCtx) {
s16 curFrame = this->skelAnime.curFrame / this->skelAnime.playSpeed;
s16 animLastFrame = Animation_GetLastFrame(&object_rs_Anim_009120) / (s16)this->skelAnime.playSpeed;
Math_SmoothStepToS(
&this->actor.world.rot.y,
EnSob1_GetXZAngleAndDistanceSqToPoint(this->path, this->pathPointsIdx - 1, &this->actor.world.pos, &distSq), 4,
1000, 1);
Math_SmoothStepToS(&this->actor.world.rot.y,
EnSob1_GetDistSqAndOrient(this->path, this->pathPointsIdx - 1, &this->actor.world.pos, &distSq),
4, 1000, 1);
this->actor.shape.rot.y = this->actor.world.rot.y;
Math_ApproachF(&this->actor.speedXZ, 0.5f, 0.2f, 1.0f);
if (distSq < 12.0f) {
@ -750,10 +749,9 @@ void EnSob1_Walk(EnSob1* this, GlobalContext* globalCtx) {
}
}
if (this->path != NULL) {
Math_SmoothStepToS(
&this->actor.world.rot.y,
EnSob1_GetXZAngleAndDistanceSqToPoint(this->path, this->pathPointsIdx, &this->actor.world.pos, &distSq), 4,
1000, 1);
Math_SmoothStepToS(&this->actor.world.rot.y,
EnSob1_GetDistSqAndOrient(this->path, this->pathPointsIdx, &this->actor.world.pos, &distSq),
4, 1000, 1);
this->actor.shape.rot.y = this->actor.world.rot.y;
this->actor.speedXZ = 2.0f;
if (distSq < SQ(5.0f)) {
@ -1249,7 +1247,7 @@ void EnSob1_UpdateStickDirectionPromptAnim(EnSob1* this) {
this->stickLeftPrompt.stickTexY = 95.0f;
}
s16 EnSob1_GetXZAngleAndDistanceSqToPoint(Path* path, s32 pointIdx, Vec3f* pos, f32* distSq) {
s16 EnSob1_GetDistSqAndOrient(Path* path, s32 pointIdx, Vec3f* pos, f32* distSq) {
Vec3s* points;
f32 diffX;
f32 diffZ;
@ -1375,7 +1373,7 @@ void EnSob1_InitShop(EnSob1* this, GlobalContext* globalCtx) {
this->pathPointsIdx = 0;
if (this->shopType == BOMB_SHOP) {
this->path = func_8013D648(globalCtx, ENSOB1_GET_PATH(&this->actor), 0x1F);
this->path = SubS_GetPathByIndex(globalCtx, ENSOB1_GET_PATH(&this->actor), 0x1F);
}
if (this->shopType == BOMB_SHOP) {
EnSob1_SetupAction(this, EnSob1_SetupWalk);

View File

@ -473,8 +473,8 @@ void func_80BAB434(EnSuttari* this) {
}
void EnSuttari_GetPaths(EnSuttari* this, GlobalContext* globalCtx) {
this->paths[0] = func_8013D648(globalCtx, ENSUTTARI_GET_PATH(&this->actor), 0x3F);
this->paths[1] = func_8013D648(globalCtx, this->paths[0]->unk1, 0x3F);
this->paths[0] = SubS_GetPathByIndex(globalCtx, ENSUTTARI_GET_PATH(&this->actor), 0x3F);
this->paths[1] = SubS_GetPathByIndex(globalCtx, this->paths[0]->unk1, 0x3F);
}
void func_80BAB4F0(EnSuttari* this, GlobalContext* globalCtx) {
@ -504,28 +504,29 @@ void func_80BAB4F0(EnSuttari* this, GlobalContext* globalCtx) {
SubS_FillLimbRotTables(globalCtx, this->unk2FA, this->unk31A, ARRAY_COUNT(this->unk2FA));
}
s16 func_80BAB698(Path* path, s32 idx, Vec3f* pos, f32* distSQ) {
s16 EnSuttari_GetDistSqAndOrient(Path* path, s32 index, Vec3f* pos, f32* distSq) {
Vec3s* points;
f32 diffX;
f32 diffZ;
if (path != NULL) {
points = Lib_SegmentedToVirtual(path->points);
points = &points[idx];
points = &points[index];
diffX = points->x - pos->x;
diffZ = points->z - pos->z;
} else {
diffX = 0.0f;
diffZ = 0.0f;
}
*distSQ = SQ(diffX) + SQ(diffZ);
return Math_Acot2F(diffZ, diffX) * (0x8000 / M_PI);
*distSq = SQ(diffX) + SQ(diffZ);
return RADF_TO_BINANG(Math_Acot2F(diffZ, diffX));
}
s32 func_80BAB758(EnSuttari* this, Path* path, s32 arg2) {
Vec3s* sp5C = Lib_SegmentedToVirtual(path->points);
s32 sp58 = path->count;
s32 idx = arg2;
s32 index = arg2;
s32 ret = false;
f32 sp54;
f32 sp48;
@ -534,16 +535,16 @@ s32 func_80BAB758(EnSuttari* this, Path* path, s32 arg2) {
f32 sp3C;
Vec3f sp30;
Math_Vec3s_ToVec3f(&sp30, &sp5C[idx]);
if (idx == 0) {
Math_Vec3s_ToVec3f(&sp30, &sp5C[index]);
if (index == 0) {
sp54 = sp5C[1].x - sp5C[0].x;
sp48 = sp5C[1].z - sp5C[0].z;
} else if (idx == sp58 - 1) {
} else if (index == sp58 - 1) {
sp54 = sp5C[sp58 - 1].x - sp5C[sp58 - 2].x;
sp48 = sp5C[sp58 - 1].z - sp5C[sp58 - 2].z;
} else {
sp54 = sp5C[idx + 1].x - sp5C[idx - 1].x;
sp48 = sp5C[idx + 1].z - sp5C[idx - 1].z;
sp54 = sp5C[index + 1].x - sp5C[index - 1].x;
sp48 = sp5C[index + 1].z - sp5C[index - 1].z;
}
func_8017B7F8(&sp30, RADF_TO_BINANG(func_80086B30(sp54, sp48)), &sp44, &sp40, &sp3C);
if (((sp44 * this->actor.world.pos.x) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
@ -554,29 +555,26 @@ s32 func_80BAB758(EnSuttari* this, Path* path, s32 arg2) {
s32 func_80BAB8F4(EnSuttari* this, Path* path, s32 arg2) {
Vec3s* sp5C = Lib_SegmentedToVirtual(path->points);
s32 sp58;
s32 sp58 = path->count;
s32 index = arg2;
s32 ret = false;
f32 sp54;
s32 ret;
s32 pad4C;
f32 sp48;
f32 sp44;
f32 sp40;
f32 sp3C;
Vec3f sp30;
if (sp5C[arg2 - 1].x) {}
sp58 = path->count;
ret = false;
Math_Vec3s_ToVec3f(&sp30, &sp5C[arg2]);
if (arg2 == 0) {
Math_Vec3s_ToVec3f(&sp30, &sp5C[index]);
if (index == 0) {
sp54 = sp5C[0].x - sp5C[1].x;
sp48 = sp5C[0].z - sp5C[1].z;
} else if (arg2 == sp58 - 1) {
} else if (index == sp58 - 1) {
sp54 = sp5C[sp58 - 2].x - sp5C[sp58 - 1].x;
sp48 = sp5C[sp58 - 2].z - sp5C[sp58 - 1].z;
} else {
sp54 = sp5C[arg2 - 1].x - sp5C[arg2 + 1].x;
sp48 = sp5C[arg2 - 1].z - sp5C[arg2 + 1].z;
sp54 = sp5C[index - 1].x - sp5C[index + 1].x;
sp48 = sp5C[index - 1].z - sp5C[index + 1].z;
}
func_8017B7F8(&sp30, RADF_TO_BINANG(func_80086B30(sp54, sp48)), &sp44, &sp40, &sp3C);
if (((sp44 * this->actor.world.pos.x) + (sp40 * this->actor.world.pos.z) + sp3C) > 0.0f) {
@ -590,7 +588,7 @@ void func_80BABA90(EnSuttari* this, s32 arg1, u8 arg2) {
f32 dist;
if (this->paths[arg1] != NULL) {
target = func_80BAB698(this->paths[arg1], this->unk1F4[arg1], &this->actor.world.pos, &dist);
target = EnSuttari_GetDistSqAndOrient(this->paths[arg1], this->unk1F4[arg1], &this->actor.world.pos, &dist);
if (this->actor.bgCheckFlags & 8) {
if (arg2 == 2) {
this->unk1F4[arg1] = -0x63;
@ -619,7 +617,7 @@ void func_80BABB90(EnSuttari* this, s32 arg1) {
f32 sp30;
if (this->paths[arg1] != NULL) {
target = func_80BAB698(this->paths[arg1], this->unk1F4[arg1], &this->actor.world.pos, &sp30);
target = EnSuttari_GetDistSqAndOrient(this->paths[arg1], this->unk1F4[arg1], &this->actor.world.pos, &sp30);
if (this->actor.bgCheckFlags & 8) {
target = this->actor.wallYaw;
}
@ -644,7 +642,7 @@ s32 func_80BABC48(EnSuttari* this, GlobalContext* globalCtx, struct_80133038_arg
u16 phi_a0;
if (sp1C >= 0) {
this->unk404 = func_8013BB34(globalCtx, sp23, sp1C);
this->unk404 = SubS_GetAdditionalPath(globalCtx, sp23, sp1C);
}
if (this->unk404 == NULL) {
return 0;
@ -686,7 +684,7 @@ s32 func_80BABDD8(EnSuttari* this, GlobalContext* globalCtx, struct_80133038_arg
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);
this->unk404 = SubS_GetAdditionalPath(globalCtx, sp47, sp24);
}
if ((sp48 == NULL) || (this->unk404 == NULL)) {
return 0;

View File

@ -1175,7 +1175,7 @@ void EnSw_Init(Actor* thisx, GlobalContext* globalCtx) {
this->collider.info.toucher.damage = 16;
}
this->unk_1E4 = func_8013BEDC(globalCtx, ENSW_GET_FF00(&this->actor), 255, &this->unk_4A0);
this->unk_1E4 = SubS_GetDayDependentPath(globalCtx, ENSW_GET_FF00(&this->actor), 255, &this->unk_4A0);
if (this->unk_1E4 != NULL) {
this->unk_4A0 = 1;
}

View File

@ -507,7 +507,7 @@ s32 func_80AED38C(EnTk* this, GlobalContext* globalCtx, struct_80133038_arg2* ar
u16 phi_a1;
s32 idx = arg2->unk0 - 1;
this->unk_3C8 = func_8013BB34(globalCtx, params, D_80AEF8E8[idx + 1]);
this->unk_3C8 = SubS_GetAdditionalPath(globalCtx, params, D_80AEF8E8[idx + 1]);
if (this->unk_3C8 == 0) {
return false;
}

View File

@ -203,7 +203,7 @@ void func_80AD36EC(EnTrt2* this, GlobalContext* globalCtx) {
this->unk_1E4 = 0;
this->unk_3D9 = 1;
this->actor.velocity.y = 0.0f;
this->path = func_8013D648(globalCtx, this->path->unk1, -1);
this->path = SubS_GetPathByIndex(globalCtx, this->path->unk1, -1);
ActorCutscene_Stop(this->unk_3DA);
this->unk_3DA = ActorCutscene_GetAdditionalCutscene(this->unk_3DA);
ActorCutscene_SetIntentToPlay(this->unk_3DA);
@ -437,7 +437,7 @@ void func_80AD417C(EnTrt2* this, GlobalContext* globalCtx) {
globalCtx->msgCtx.unk12023 = 4;
if (this->unk_3A8 == 0x84C) {
func_80AD3380(&this->skelAnime, sAnimations, 6);
this->path = func_8013D648(globalCtx, ENTRT2_GET_FC00(&this->actor), 0x3F);
this->path = SubS_GetPathByIndex(globalCtx, ENTRT2_GET_FC00(&this->actor), 0x3F);
this->unk_3B2 = 18;
} else if (this->unk_3A8 == 0x88F) {
this->unk_3A8 = 0x88E;
@ -708,7 +708,7 @@ void func_80AD4DB4(EnTrt2* this, GlobalContext* globalCtx) {
this->actor.flags &= ~ACTOR_FLAG_10;
Actor_SetObjectDependency(globalCtx, &this->actor);
Actor_SetScale(&this->actor, 0.008f);
this->path = func_8013D648(globalCtx, ENTRT2_GET_FC00(&this->actor), 0x3F);
this->path = SubS_GetPathByIndex(globalCtx, ENTRT2_GET_FC00(&this->actor), 0x3F);
this->unk_3AE = Rand_S16Offset(100, 50);
this->unk_3B0 = 10;
this->unk_3A8 = 0;

View File

@ -723,7 +723,7 @@ s32 func_80A87400(EnTru* this, GlobalContext* globalCtx) {
if (this->path != NULL) {
sp4C = Lib_SegmentedToVirtual(this->path->points);
if (func_8013BD40(&this->actor, this->path, this->unk_384)) {
if (SubS_HasReachedPoint(&this->actor, this->path, this->unk_384)) {
if (this->unk_384 > this->unk_384 + 1) {
this->unk_384 = this->path->count - 2;
ret = true;
@ -1127,7 +1127,7 @@ void EnTru_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x16), &sColChkInfoInit);
this->unk_37C = -1;
func_80A86924(this, 0);
this->path = func_8013BEDC(globalCtx, this->actor.params & 0xFF, 255, &this->unk_384);
this->path = SubS_GetDayDependentPath(globalCtx, this->actor.params & 0xFF, 255, &this->unk_384);
if (this->path != NULL) {
this->unk_384 = 1;
}

View File

@ -412,7 +412,7 @@ void EnTruMt_Init(Actor* thisx, GlobalContext* globalCtx) {
this->collider.dim.worldSphere.radius = 22;
this->actor.colChkInfo.damageTable = &sDamageTable;
this->path = func_8013D648(globalCtx, ENTRUMT_GET_FF(&this->actor), 0x3F);
this->path = SubS_GetPathByIndex(globalCtx, ENTRUMT_GET_FF(&this->actor), 0x3F);
this->actor.targetMode = 0;
Actor_SetScale(&this->actor, 0.008f);
@ -420,7 +420,7 @@ void EnTruMt_Init(Actor* thisx, GlobalContext* globalCtx) {
this->unk_328 = 0;
this->actor.room = -1;
this->path = func_8013D648(globalCtx, ENTRUMT_GET_FC00(&this->actor), 0x3F);
this->path = SubS_GetPathByIndex(globalCtx, ENTRUMT_GET_FC00(&this->actor), 0x3F);
func_80B76030(&this->skelAnime, 14);
this->actionFunc = func_80B76A64;
}

View File

@ -141,12 +141,12 @@ s32 EnZo_PlayWalkingSound(EnZo* this, GlobalContext* globalCtx) {
sfxId = SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId) + SFX_FLAG;
}
this->isLeftFootGrounded = isFootGrounded = func_8013DB90(globalCtx, &this->leftFootPos, -6.0f);
this->isLeftFootGrounded = isFootGrounded = SubS_IsFloorAbove(globalCtx, &this->leftFootPos, -6.0f);
if ((this->isLeftFootGrounded) && (!leftWasGrounded) && (isFootGrounded)) {
Actor_PlaySfxAtPos(&this->actor, sfxId);
}
this->isRightFootGrounded = isFootGrounded = func_8013DB90(globalCtx, &this->rightFootPos, -6.0f);
this->isRightFootGrounded = isFootGrounded = SubS_IsFloorAbove(globalCtx, &this->rightFootPos, -6.0f);
if ((this->isRightFootGrounded) && (!rightWasGrounded) && (isFootGrounded)) {
Actor_PlaySfxAtPos(&this->actor, sfxId);
}
@ -218,7 +218,7 @@ void EnZo_FollowPath(EnZo* this, GlobalContext* globalCtx) {
Math_SmoothStepToF(&this->actor.speedXZ, 1.0f, 0.4f, 1000.0f, 0.0f);
speed = this->actor.speedXZ * 400.0f;
if (func_8013D68C(this->path, this->waypoint, &pos) && func_8013D768(&this->actor, &pos, speed)) {
if (SubS_CopyPointFromPath(this->path, this->waypoint, &pos) && SubS_MoveActorToPoint(&this->actor, &pos, speed)) {
this->waypoint++;
if (this->waypoint >= this->path->count) {
this->waypoint = 0;
@ -259,7 +259,7 @@ void EnZo_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
this->path = func_8013D648(globalCtx, ENZO_GET_PATH(&this->actor), ENZO_NO_PATH);
this->path = SubS_GetPathByIndex(globalCtx, ENZO_GET_PATH(&this->actor), ENZO_NO_PATH);
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = EnZo_Walk;

View File

@ -452,6 +452,18 @@ animdict = {
"func_8013E054": "SubS_ActorPathing_MoveWithGravity",
"func_8013E07C": "SubS_ActorPathing_MoveWithoutGravityReverse",
"func_8013E0A4": "SubS_ActorPathing_SetNextPoint",
"func_8013BB34": "SubS_GetAdditionalPath",
"func_8013BD40": "SubS_HasReachedPoint",
"func_8013BEDC": "SubS_GetDayDependentPath",
"func_8013C8B8": "SubS_CopyPointFromPathCheckBounds",
"func_8013D648": "SubS_GetPathByIndex",
"func_8013D68C": "SubS_CopyPointFromPath",
"func_8013D720": "SubS_GetDistSqAndOrientPoints",
"func_8013D768": "SubS_MoveActorToPoint",
"func_8013D83C": "SubS_GetDistSqAndOrientPath",
"func_8013DB90": "SubS_IsFloorAbove",
"func_8013DC40": "SubS_CopyPointFromPathList",
"func_8013DCCC": "SubS_GetPathCount",
"func_80147624": "Message_ShouldAdvance",
"func_80147734": "Message_ShouldAdvanceSilent",

View File

@ -2667,14 +2667,14 @@
0x8013B350:("func_8013B350",),
0x8013B6B0:("func_8013B6B0",),
0x8013B878:("func_8013B878",),
0x8013BB34:("func_8013BB34",),
0x8013BB34:("SubS_GetAdditionalPath",),
0x8013BB7C:("SubS_FindNearestActor",),
0x8013BC6C:("SubS_ChangeAnimationByInfoS",),
0x8013BD40:("func_8013BD40",),
0x8013BEDC:("func_8013BEDC",),
0x8013BD40:("SubS_HasReachedPoint",),
0x8013BEDC:("SubS_GetDayDependentPath",),
0x8013C068:("func_8013C068",),
0x8013C624:("func_8013C624",),
0x8013C8B8:("func_8013C8B8",),
0x8013C8B8:("SubS_CopyPointFromPathCheckBounds",),
0x8013C964:("func_8013C964",),
0x8013CC2C:("func_8013CC2C",),
0x8013CD64:("func_8013CD64",),
@ -2682,18 +2682,18 @@
0x8013D0E0:("func_8013D0E0",),
0x8013D2E0:("func_8013D2E0",),
0x8013D5E8:("SubS_AngleDiffLessEqual",),
0x8013D648:("func_8013D648",),
0x8013D68C:("func_8013D68C",),
0x8013D720:("func_8013D720",),
0x8013D768:("func_8013D768",),
0x8013D83C:("func_8013D83C",),
0x8013D648:("SubS_GetPathByIndex",),
0x8013D68C:("SubS_CopyPointFromPath",),
0x8013D720:("SubS_GetDistSqAndOrientPoints",),
0x8013D768:("SubS_MoveActorToPoint",),
0x8013D83C:("SubS_GetDistSqAndOrientPath",),
0x8013D8DC:("SubS_IsObjectLoaded",),
0x8013D924:("SubS_GetObjectIndex",),
0x8013D960:("SubS_FindActor",),
0x8013D9C8:("SubS_FillLimbRotTables",),
0x8013DB90:("func_8013DB90",),
0x8013DC40:("func_8013DC40",),
0x8013DCCC:("func_8013DCCC",),
0x8013DB90:("SubS_IsFloorAbove",),
0x8013DC40:("SubS_CopyPointFromPathList",),
0x8013DCCC:("SubS_GetPathCount",),
0x8013DCE0:("SubS_ActorPathing_Init",),
0x8013DE04:("SubS_ActorPathing_Update",),
0x8013DF3C:("SubS_ActorPathing_ComputePointInfo",),
@ -9654,7 +9654,7 @@
0x80A0EEC8:("EnSob1_UpdateItemSelectedProperty",),
0x80A0EF48:("EnSob1_UpdateCursorAnim",),
0x80A0F014:("EnSob1_UpdateStickDirectionPromptAnim",),
0x80A0F1C4:("EnSob1_GetXZAngleAndDistanceSqToPoint",),
0x80A0F1C4:("EnSob1_GetDistSqAndOrient",),
0x80A0F284:("EnSob1_GetCutscenes",),
0x80A0F2C8:("EnSob1_WaitForBlink",),
0x80A0F2FC:("EnSob1_Blink",),
@ -15211,7 +15211,7 @@
0x80BAB434:("func_80BAB434",),
0x80BAB490:("EnSuttari_GetPaths",),
0x80BAB4F0:("func_80BAB4F0",),
0x80BAB698:("func_80BAB698",),
0x80BAB698:("EnSuttari_GetDistSqAndOrient",),
0x80BAB758:("func_80BAB758",),
0x80BAB8F4:("func_80BAB8F4",),
0x80BABA90:("func_80BABA90",),

View File

@ -2181,14 +2181,14 @@ asm/non_matchings/code/z_sub_s/func_8013B0C8.s,func_8013B0C8,0x8013B0C8,0xA2
asm/non_matchings/code/z_sub_s/func_8013B350.s,func_8013B350,0x8013B350,0xD8
asm/non_matchings/code/z_sub_s/func_8013B6B0.s,func_8013B6B0,0x8013B6B0,0x72
asm/non_matchings/code/z_sub_s/func_8013B878.s,func_8013B878,0x8013B878,0xAF
asm/non_matchings/code/z_sub_s/func_8013BB34.s,func_8013BB34,0x8013BB34,0x12
asm/non_matchings/code/z_sub_s/SubS_GetAdditionalPath.s,SubS_GetAdditionalPath,0x8013BB34,0x12
asm/non_matchings/code/z_sub_s/SubS_FindNearestActor.s,SubS_FindNearestActor,0x8013BB7C,0x3C
asm/non_matchings/code/z_sub_s/SubS_ChangeAnimationByInfoS.s,SubS_ChangeAnimationByInfoS,0x8013BC6C,0x35
asm/non_matchings/code/z_sub_s/func_8013BD40.s,func_8013BD40,0x8013BD40,0x67
asm/non_matchings/code/z_sub_s/func_8013BEDC.s,func_8013BEDC,0x8013BEDC,0x63
asm/non_matchings/code/z_sub_s/SubS_HasReachedPoint.s,SubS_HasReachedPoint,0x8013BD40,0x67
asm/non_matchings/code/z_sub_s/SubS_GetDayDependentPath.s,SubS_GetDayDependentPath,0x8013BEDC,0x63
asm/non_matchings/code/z_sub_s/func_8013C068.s,func_8013C068,0x8013C068,0x16F
asm/non_matchings/code/z_sub_s/func_8013C624.s,func_8013C624,0x8013C624,0xA5
asm/non_matchings/code/z_sub_s/func_8013C8B8.s,func_8013C8B8,0x8013C8B8,0x2B
asm/non_matchings/code/z_sub_s/SubS_CopyPointFromPathCheckBounds.s,SubS_CopyPointFromPathCheckBounds,0x8013C8B8,0x2B
asm/non_matchings/code/z_sub_s/func_8013C964.s,func_8013C964,0x8013C964,0xB2
asm/non_matchings/code/z_sub_s/func_8013CC2C.s,func_8013CC2C,0x8013CC2C,0x4E
asm/non_matchings/code/z_sub_s/func_8013CD64.s,func_8013CD64,0x8013CD64,0x68
@ -2196,18 +2196,18 @@ asm/non_matchings/code/z_sub_s/func_8013CF04.s,func_8013CF04,0x8013CF04,0x77
asm/non_matchings/code/z_sub_s/func_8013D0E0.s,func_8013D0E0,0x8013D0E0,0x80
asm/non_matchings/code/z_sub_s/func_8013D2E0.s,func_8013D2E0,0x8013D2E0,0xC2
asm/non_matchings/code/z_sub_s/SubS_AngleDiffLessEqual.s,SubS_AngleDiffLessEqual,0x8013D5E8,0x18
asm/non_matchings/code/z_sub_s/func_8013D648.s,func_8013D648,0x8013D648,0x11
asm/non_matchings/code/z_sub_s/func_8013D68C.s,func_8013D68C,0x8013D68C,0x25
asm/non_matchings/code/z_sub_s/func_8013D720.s,func_8013D720,0x8013D720,0x12
asm/non_matchings/code/z_sub_s/func_8013D768.s,func_8013D768,0x8013D768,0x35
asm/non_matchings/code/z_sub_s/func_8013D83C.s,func_8013D83C,0x8013D83C,0x28
asm/non_matchings/code/z_sub_s/SubS_GetPathByIndex.s,SubS_GetPathByIndex,0x8013D648,0x11
asm/non_matchings/code/z_sub_s/SubS_CopyPointFromPath.s,SubS_CopyPointFromPath,0x8013D68C,0x25
asm/non_matchings/code/z_sub_s/SubS_GetDistSqAndOrientPoints.s,SubS_GetDistSqAndOrientPoints,0x8013D720,0x12
asm/non_matchings/code/z_sub_s/SubS_MoveActorToPoint.s,SubS_MoveActorToPoint,0x8013D768,0x35
asm/non_matchings/code/z_sub_s/SubS_GetDistSqAndOrientPath.s,SubS_GetDistSqAndOrientPath,0x8013D83C,0x28
asm/non_matchings/code/z_sub_s/SubS_IsObjectLoaded.s,SubS_IsObjectLoaded,0x8013D8DC,0x12
asm/non_matchings/code/z_sub_s/SubS_GetObjectIndex.s,SubS_GetObjectIndex,0x8013D924,0xF
asm/non_matchings/code/z_sub_s/SubS_FindActor.s,SubS_FindActor,0x8013D960,0x1A
asm/non_matchings/code/z_sub_s/SubS_FillLimbRotTables.s,SubS_FillLimbRotTables,0x8013D9C8,0x72
asm/non_matchings/code/z_sub_s/func_8013DB90.s,func_8013DB90,0x8013DB90,0x2C
asm/non_matchings/code/z_sub_s/func_8013DC40.s,func_8013DC40,0x8013DC40,0x23
asm/non_matchings/code/z_sub_s/func_8013DCCC.s,func_8013DCCC,0x8013DCCC,0x5
asm/non_matchings/code/z_sub_s/SubS_IsFloorAbove.s,SubS_IsFloorAbove,0x8013DB90,0x2C
asm/non_matchings/code/z_sub_s/SubS_CopyPointFromPathList.s,SubS_CopyPointFromPathList,0x8013DC40,0x23
asm/non_matchings/code/z_sub_s/SubS_GetPathCount.s,SubS_GetPathCount,0x8013DCCC,0x5
asm/non_matchings/code/z_sub_s/SubS_ActorPathing_Init.s,SubS_ActorPathing_Init,0x8013DCE0,0x49
asm/non_matchings/code/z_sub_s/SubS_ActorPathing_Update.s,SubS_ActorPathing_Update,0x8013DE04,0x4E
asm/non_matchings/code/z_sub_s/SubS_ActorPathing_ComputePointInfo.s,SubS_ActorPathing_ComputePointInfo,0x8013DF3C,0x46

1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
2181 asm/non_matchings/code/z_sub_s/func_8013B350.s func_8013B350 0x8013B350 0xD8
2182 asm/non_matchings/code/z_sub_s/func_8013B6B0.s func_8013B6B0 0x8013B6B0 0x72
2183 asm/non_matchings/code/z_sub_s/func_8013B878.s func_8013B878 0x8013B878 0xAF
2184 asm/non_matchings/code/z_sub_s/func_8013BB34.s asm/non_matchings/code/z_sub_s/SubS_GetAdditionalPath.s func_8013BB34 SubS_GetAdditionalPath 0x8013BB34 0x12
2185 asm/non_matchings/code/z_sub_s/SubS_FindNearestActor.s SubS_FindNearestActor 0x8013BB7C 0x3C
2186 asm/non_matchings/code/z_sub_s/SubS_ChangeAnimationByInfoS.s SubS_ChangeAnimationByInfoS 0x8013BC6C 0x35
2187 asm/non_matchings/code/z_sub_s/func_8013BD40.s asm/non_matchings/code/z_sub_s/SubS_HasReachedPoint.s func_8013BD40 SubS_HasReachedPoint 0x8013BD40 0x67
2188 asm/non_matchings/code/z_sub_s/func_8013BEDC.s asm/non_matchings/code/z_sub_s/SubS_GetDayDependentPath.s func_8013BEDC SubS_GetDayDependentPath 0x8013BEDC 0x63
2189 asm/non_matchings/code/z_sub_s/func_8013C068.s func_8013C068 0x8013C068 0x16F
2190 asm/non_matchings/code/z_sub_s/func_8013C624.s func_8013C624 0x8013C624 0xA5
2191 asm/non_matchings/code/z_sub_s/func_8013C8B8.s asm/non_matchings/code/z_sub_s/SubS_CopyPointFromPathCheckBounds.s func_8013C8B8 SubS_CopyPointFromPathCheckBounds 0x8013C8B8 0x2B
2192 asm/non_matchings/code/z_sub_s/func_8013C964.s func_8013C964 0x8013C964 0xB2
2193 asm/non_matchings/code/z_sub_s/func_8013CC2C.s func_8013CC2C 0x8013CC2C 0x4E
2194 asm/non_matchings/code/z_sub_s/func_8013CD64.s func_8013CD64 0x8013CD64 0x68
2196 asm/non_matchings/code/z_sub_s/func_8013D0E0.s func_8013D0E0 0x8013D0E0 0x80
2197 asm/non_matchings/code/z_sub_s/func_8013D2E0.s func_8013D2E0 0x8013D2E0 0xC2
2198 asm/non_matchings/code/z_sub_s/SubS_AngleDiffLessEqual.s SubS_AngleDiffLessEqual 0x8013D5E8 0x18
2199 asm/non_matchings/code/z_sub_s/func_8013D648.s asm/non_matchings/code/z_sub_s/SubS_GetPathByIndex.s func_8013D648 SubS_GetPathByIndex 0x8013D648 0x11
2200 asm/non_matchings/code/z_sub_s/func_8013D68C.s asm/non_matchings/code/z_sub_s/SubS_CopyPointFromPath.s func_8013D68C SubS_CopyPointFromPath 0x8013D68C 0x25
2201 asm/non_matchings/code/z_sub_s/func_8013D720.s asm/non_matchings/code/z_sub_s/SubS_GetDistSqAndOrientPoints.s func_8013D720 SubS_GetDistSqAndOrientPoints 0x8013D720 0x12
2202 asm/non_matchings/code/z_sub_s/func_8013D768.s asm/non_matchings/code/z_sub_s/SubS_MoveActorToPoint.s func_8013D768 SubS_MoveActorToPoint 0x8013D768 0x35
2203 asm/non_matchings/code/z_sub_s/func_8013D83C.s asm/non_matchings/code/z_sub_s/SubS_GetDistSqAndOrientPath.s func_8013D83C SubS_GetDistSqAndOrientPath 0x8013D83C 0x28
2204 asm/non_matchings/code/z_sub_s/SubS_IsObjectLoaded.s SubS_IsObjectLoaded 0x8013D8DC 0x12
2205 asm/non_matchings/code/z_sub_s/SubS_GetObjectIndex.s SubS_GetObjectIndex 0x8013D924 0xF
2206 asm/non_matchings/code/z_sub_s/SubS_FindActor.s SubS_FindActor 0x8013D960 0x1A
2207 asm/non_matchings/code/z_sub_s/SubS_FillLimbRotTables.s SubS_FillLimbRotTables 0x8013D9C8 0x72
2208 asm/non_matchings/code/z_sub_s/func_8013DB90.s asm/non_matchings/code/z_sub_s/SubS_IsFloorAbove.s func_8013DB90 SubS_IsFloorAbove 0x8013DB90 0x2C
2209 asm/non_matchings/code/z_sub_s/func_8013DC40.s asm/non_matchings/code/z_sub_s/SubS_CopyPointFromPathList.s func_8013DC40 SubS_CopyPointFromPathList 0x8013DC40 0x23
2210 asm/non_matchings/code/z_sub_s/func_8013DCCC.s asm/non_matchings/code/z_sub_s/SubS_GetPathCount.s func_8013DCCC SubS_GetPathCount 0x8013DCCC 0x5
2211 asm/non_matchings/code/z_sub_s/SubS_ActorPathing_Init.s SubS_ActorPathing_Init 0x8013DCE0 0x49
2212 asm/non_matchings/code/z_sub_s/SubS_ActorPathing_Update.s SubS_ActorPathing_Update 0x8013DE04 0x4E
2213 asm/non_matchings/code/z_sub_s/SubS_ActorPathing_ComputePointInfo.s SubS_ActorPathing_ComputePointInfo 0x8013DF3C 0x46