mirror of
https://github.com/zeldaret/mm.git
synced 2026-05-27 08:04:36 -04:00
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
This commit is contained in:
+2
-2
@@ -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;
|
||||
|
||||
+9
-9
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user