diff options
| author | elijah-thomas774 <elijahthomas774@gmail.com> | 2026-05-24 15:02:22 -0400 |
|---|---|---|
| committer | elijah-thomas774 <elijahthomas774@gmail.com> | 2026-05-24 20:34:43 -0400 |
| commit | 45cc86893d40285ef48d7da8107ce9f8011c68f4 (patch) | |
| tree | 00539eed6018551354a521ad11698b9de8402731 /src | |
| parent | c15f7fb519b46f64f0de51063b2adb270f730b10 (diff) | |
ActorOnRail_Ext getPoint Inline return type change to mVec3_c* instead of Vec*
Diffstat (limited to 'src')
| -rw-r--r-- | src/REL/d/a/e/d_a_e_ks.cpp | 8 | ||||
| -rw-r--r-- | src/toBeSorted/d_path.cpp | 3 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/REL/d/a/e/d_a_e_ks.cpp b/src/REL/d/a/e/d_a_e_ks.cpp index c9f1ca83..8a1d8f36 100644 --- a/src/REL/d/a/e/d_a_e_ks.cpp +++ b/src/REL/d/a/e/d_a_e_ks.cpp @@ -3047,7 +3047,7 @@ void dAcEKs_c::executeState_PathMove() { } field_0xDCA = mRail.getPath().getPointParam(idx, 0); if (checkPathPntParam(field_0xDCA)) { - setStartingPosition(*(const mVec3_c *)mRail.getPath().getPoint(idx)); + setStartingPosition(*mRail.getPoint(idx)); mStartingPos.y = getLineCrossYRange(getStartingPosition(), 300); changeState(StateID_ReturnToWait); return; @@ -3058,10 +3058,10 @@ void dAcEKs_c::executeState_PathMove() { } if (field_0xDC9 == 1) { field_0xDC9 = 2; - mVec3_c pnt; const s32 pntIdx = mRail.getClosestXZPoint(mPosition); - const Vec *pPnt = mRail.getPoint(pntIdx); - pnt.copyFrom(pPnt); + + mVec3_c pnt = *mRail.getPoint(pntIdx); + if (mRail.getPosition().squareDistanceToXZ(mPosition) > pnt.squareDistanceToXZ(mPosition)) { mRail.setSegment(pntIdx, 0.f); setStartingPosition(mRail.getPosition()); diff --git a/src/toBeSorted/d_path.cpp b/src/toBeSorted/d_path.cpp index 6a539796..0003a739 100644 --- a/src/toBeSorted/d_path.cpp +++ b/src/toBeSorted/d_path.cpp @@ -610,8 +610,7 @@ s32 ActorOnRail_Ext::getClosestXZPoint(const mVec3_c &pos) const { s32 best = 0; mVec3_c c; for (s32 i = 0; i < mPath.getNumPoints(); i++) { - const Vec *point = mPath.getPoint(i); - c = *reinterpret_cast<const mVec3_c *>(point) - pos; + c = *getPoint(i) - pos; f32 dist = c.squareMagXZ(); if (max > dist) { best = i; |
