summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2023-06-04 19:46:39 -0700
committerGitHub <noreply@github.com>2023-06-05 12:46:39 +1000
commitcd53dd317fa1ce2958f2c6af618059a31db59076 (patch)
tree3a5049342741e202ea94e2df39d08f3001e4f742 /src/code
parent47bc7c12e2d28b8d8ed1cff8df9c17395aefce80 (diff)
Some pathing docs (#1205)
* Some pathing docs * Missed one * Uno mas * Uno mas x2 * Cleanup * fix * namefixer * NULL * More * PR * Actually remove SQ * -1 define, plus some more pathing cleanup * Actor macros instead * Format * ADDITIONAL_PATH_INDEX_NONE * Remove reliance on PATH_INDEX_NONE * Missed some PathIndex cleanup * Review * format
Diffstat (limited to 'src/code')
-rw-r--r--src/code/z_path.c4
-rw-r--r--src/code/z_sub_s.c18
2 files changed, 11 insertions, 11 deletions
diff --git a/src/code/z_path.c b/src/code/z_path.c
index 3c446d49a..76d7ce144 100644
--- a/src/code/z_path.c
+++ b/src/code/z_path.c
@@ -1,9 +1,9 @@
#include "global.h"
-Path* Path_GetByIndex(PlayState* play, s16 index, s16 max) {
+Path* Path_GetByIndex(PlayState* play, s16 index, s16 indexNone) {
Path* path;
- if (index != max) {
+ if (index != indexNone) {
path = &play->setupPathList[index];
} else {
path = NULL;
diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c
index 05a3c331e..35886da18 100644
--- a/src/code/z_sub_s.c
+++ b/src/code/z_sub_s.c
@@ -489,9 +489,9 @@ Path* SubS_GetAdditionalPath(PlayState* play, u8 pathIndex, s32 limit) {
if (i >= limit) {
break;
}
- pathIndex = path->unk1;
+ pathIndex = path->additionalPathIndex;
i++;
- } while (pathIndex != 0xFF);
+ } while (pathIndex != ADDITIONAL_PATH_INDEX_NONE);
return path;
}
@@ -585,7 +585,7 @@ s32 SubS_HasReachedPoint(Actor* actor, Path* path, s32 pointIndex) {
return reached;
}
-Path* SubS_GetDayDependentPath(PlayState* play, u8 pathIndex, u8 max, s32* startPointIndex) {
+Path* SubS_GetDayDependentPath(PlayState* play, u8 pathIndex, u8 pathIndexNone, s32* startPointIndex) {
Path* path = NULL;
s32 found = false;
s32 time = (((s16)TIME_TO_MINUTES_F(gSaveContext.save.time) % 60) +
@@ -593,17 +593,17 @@ Path* SubS_GetDayDependentPath(PlayState* play, u8 pathIndex, u8 max, s32* start
30;
s32 day = CURRENT_DAY;
- if (pathIndex == max) {
+ if (pathIndex == pathIndexNone) {
return NULL;
}
- while (pathIndex != 0xFF) {
+ while (pathIndex != ADDITIONAL_PATH_INDEX_NONE) {
path = &play->setupPathList[pathIndex];
- if (sPathDayFlags[day] & path->unk2) {
+ if (path->customValue & sPathDayFlags[day]) {
found = true;
break;
}
- pathIndex = path->unk1;
+ pathIndex = path->additionalPathIndex;
}
if (found == true) {
@@ -1098,8 +1098,8 @@ s32 SubS_AngleDiffLessEqual(s16 angleA, s16 threshold, s16 angleB) {
return (ABS_ALT(BINANG_SUB(angleB, angleA)) <= threshold) ? true : false;
}
-Path* SubS_GetPathByIndex(PlayState* play, s16 pathIndex, s16 max) {
- return (pathIndex != max) ? &play->setupPathList[pathIndex] : NULL;
+Path* SubS_GetPathByIndex(PlayState* play, s16 pathIndex, s16 pathIndexNone) {
+ return (pathIndex != pathIndexNone) ? &play->setupPathList[pathIndex] : NULL;
}
s32 SubS_CopyPointFromPath(Path* path, s32 pointIndex, Vec3f* dst) {