Closed JordanLongstaff closed 3 weeks ago
For context, here's the crash, it's in the FollowPath
method which is called when Mido walks away from the path leading to the Deku Tree:
u8 EnMd_FollowPath(EnMd* this, PlayState* play) {
Path* path;
Vec3s* pointPos;
f32 pathDiffX;
f32 pathDiffZ;
if ((this->actor.params & 0xFF00) == 0xFF00) {
return 0;
}
path = &play->setupPathList[(this->actor.params & 0xFF00) >> 8];
pointPos = SEGMENTED_TO_VIRTUAL(path->points);
pointPos += this->waypoint;
pathDiffX = pointPos->x - this->actor.world.pos.x; // BOOM
pathDiffZ = pointPos->z - this->actor.world.pos.z;
Math_SmoothStepToS(&this->actor.world.rot.y, Math_FAtan2F(pathDiffX, pathDiffZ) * (65536.0f / (2 * M_PI)), 4, 4000,
1);
// ...
}
It seems to me that setupPathList
isn't initialized properly by the time it's called here.
I think this might be another of the many things that got upended by the VB overhaul of PR #3755.
I've confirmed it now. If I revert the change that PR made to Mido's actor, the crash is gone.
For reproduction, intro skip needs to be off and you need to set forest to Open
It seems to me that
setupPathList
isn't initialized properly by the time it's called here.
Not quite that it's not initialized, but it's initialized with different data (likely the pathing that navi takes in this cutscene). A simple check fixed it nice find 👍
I started a Rando game in Hell Mode, and during the cutscene where Navi flies away from the Deku Tree to find Link, I got a crash in
soh/src/overlays/actors/ovl_En_Md/z_en_md.c
at line 581.Call stack: