From ed37919018b3a79886fa631f053e078593db87eb Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 8 May 2020 15:49:27 -0400 Subject: [PATCH] CPathFindRegion: Resolve sign conversion warning The only place this is used is in an unsigned context. --- Runtime/World/CPathFindRegion.cpp | 9 ++++++--- Runtime/World/CPathFindRegion.hpp | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Runtime/World/CPathFindRegion.cpp b/Runtime/World/CPathFindRegion.cpp index 1a2f116f8..f6ec10d2c 100644 --- a/Runtime/World/CPathFindRegion.cpp +++ b/Runtime/World/CPathFindRegion.cpp @@ -162,14 +162,17 @@ bool CPFRegion::FindBestPoint(std::vector& polyPoints, const ze return found; } -void CPFRegion::SetLinkTo(s32 idx) { - if (x8_numLinks <= 0) +void CPFRegion::SetLinkTo(u32 idx) { + if (x8_numLinks <= 0) { return; - for (u32 i = 0; i < x8_numLinks; ++i) + } + + for (u32 i = 0; i < x8_numLinks; ++i) { if (xc_startLink[i].GetRegion() == idx) { Data()->SetPathLink(i); return; } + } } void CPFRegion::DropToGround(zeus::CVector3f& point) const { diff --git a/Runtime/World/CPathFindRegion.hpp b/Runtime/World/CPathFindRegion.hpp index a0cc8509e..7c587430d 100644 --- a/Runtime/World/CPathFindRegion.hpp +++ b/Runtime/World/CPathFindRegion.hpp @@ -72,7 +72,7 @@ public: bool) const; bool FindBestPoint(std::vector& polyPoints, const zeus::CVector3f& point, u32 flags, float paddingSq) const; - void SetLinkTo(s32 idx); + void SetLinkTo(u32 idx); void DropToGround(zeus::CVector3f& point) const; zeus::CVector3f GetLinkMidPoint(const CPFLink& link) const; zeus::CVector3f FitThroughLink2d(const zeus::CVector3f& p1, const CPFLink& link, const zeus::CVector3f& p2,