1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-22 14:55:39 +00:00

Document EnGo path param

This commit is contained in:
feacur 2024-11-10 15:20:44 +01:00
parent 3411f1e508
commit 687e70e33d

View file

@ -95,6 +95,9 @@ typedef enum EnGoType {
ENGO_TYPE_DMT_BIGGORON = 0x90 ENGO_TYPE_DMT_BIGGORON = 0x90
} EnGoType; } EnGoType;
#define ENGO_GET_PATH_INDEX(this) PARAMS_GET_U((this)->actor.params, 0, 4)
#define ENGO_PATH_INDEX_NONE 0xF // likely the count of available paths
void EnGo_SetupAction(EnGo* this, EnGoActionFunc actionFunc) { void EnGo_SetupAction(EnGo* this, EnGoActionFunc actionFunc) {
this->actionFunc = actionFunc; this->actionFunc = actionFunc;
} }
@ -481,11 +484,11 @@ s32 EnGo_FollowPath(EnGo* this, PlayState* play) {
f32 xDist; f32 xDist;
f32 zDist; f32 zDist;
if (PARAMS_GET_U(this->actor.params, 0, 4) == 15) { if (ENGO_GET_PATH_INDEX(this) == ENGO_PATH_INDEX_NONE) {
return false; return false;
} }
path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 4)]; path = &play->pathList[ENGO_GET_PATH_INDEX(this)];
pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos = SEGMENTED_TO_VIRTUAL(path->points);
pointPos += this->unk_218; pointPos += this->unk_218;
xDist = pointPos->x - this->actor.world.pos.x; xDist = pointPos->x - this->actor.world.pos.x;
@ -516,10 +519,10 @@ s32 EnGo_SetMovedPos(EnGo* this, PlayState* play) {
Path* path; Path* path;
Vec3s* pointPos; Vec3s* pointPos;
if (PARAMS_GET_U(this->actor.params, 0, 4) == 0xF) { if (ENGO_GET_PATH_INDEX(this) == ENGO_PATH_INDEX_NONE) {
return false; return false;
} else { } else {
path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 4)]; path = &play->pathList[ENGO_GET_PATH_INDEX(this)];
pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos = SEGMENTED_TO_VIRTUAL(path->points);
pointPos += (path->count - 1); pointPos += (path->count - 1);
this->actor.world.pos.x = pointPos->x; this->actor.world.pos.x = pointPos->x;