From 8baab44a5d1b70a767b30dfda3ef5a25621f77ff Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 8 May 2020 15:52:15 -0400 Subject: [PATCH] CPathFindRegion: Make const variant of Data() return a const qualified member Enforces read-only pointer semantics --- Runtime/World/CPathFindRegion.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Runtime/World/CPathFindRegion.hpp b/Runtime/World/CPathFindRegion.hpp index 7c587430d..5bb294f88 100644 --- a/Runtime/World/CPathFindRegion.hpp +++ b/Runtime/World/CPathFindRegion.hpp @@ -52,26 +52,34 @@ class CPFRegion { public: CPFRegion() = default; explicit CPFRegion(CMemoryInStream& in); + void SetData(CPFRegionData* data) { x4c_regionData = data; } - CPFRegionData* Data() const { return x4c_regionData; } + CPFRegionData* Data() { return x4c_regionData; } + const CPFRegionData* Data() const { return x4c_regionData; } + u32 GetIndex() const { return x24_regionIdx; } float GetHeight() const { return x14_height; } const CPFLink* GetPathLink() const; u32 GetNumLinks() const { return x8_numLinks; } u32 GetFlags() const { return x10_flags; } const CPFLink* GetLink(u32 i) const { return xc_startLink + i; } + void SetCentroid(const zeus::CVector3f& c) { x28_centroid = c; } const zeus::CVector3f& GetCentroid() const { return x28_centroid; } + void Fixup(CPFArea& area, u32& maxRegionNodes); bool IsPointInside(const zeus::CVector3f& point) const; + const zeus::CVector3f& GetNormal() const { return x18_normal; } u32 GetNumNodes() const { return x0_numNodes; } const CPFNode* GetNode(u32 i) const { return x4_startNode + i; } + float PointHeight(const zeus::CVector3f& point) const; bool FindClosestPointOnPolygon(const std::vector&, const zeus::CVector3f&, const zeus::CVector3f&, bool) const; bool FindBestPoint(std::vector& polyPoints, const zeus::CVector3f& point, u32 flags, float paddingSq) const; + void SetLinkTo(u32 idx); void DropToGround(zeus::CVector3f& point) const; zeus::CVector3f GetLinkMidPoint(const CPFLink& link) const;