From cd53dd317fa1ce2958f2c6af618059a31db59076 Mon Sep 17 00:00:00 2001 From: Derek Hensley Date: Sun, 4 Jun 2023 19:46:39 -0700 Subject: 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 --- src/code/z_path.c | 4 ++-- src/code/z_sub_s.c | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/code') 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) { -- cgit v1.2.3