diff --git a/Runtime/World/CPathFindSearch.cpp b/Runtime/World/CPathFindSearch.cpp index a8de88774..3cdb5dab2 100644 --- a/Runtime/World/CPathFindSearch.cpp +++ b/Runtime/World/CPathFindSearch.cpp @@ -357,9 +357,10 @@ void CPathFindVisualizer::Draw(const CPathFindSearch& path) { m_spline.Render(); } -void CPathFindSearch::DebugDraw() const { - if (!m_viz) +void CPathFindSearch::DebugDraw() { + if (!m_viz) { m_viz.emplace(); + } m_viz->Draw(*this); } diff --git a/Runtime/World/CPathFindSearch.hpp b/Runtime/World/CPathFindSearch.hpp index ce5a37d6e..1843b6042 100644 --- a/Runtime/World/CPathFindSearch.hpp +++ b/Runtime/World/CPathFindSearch.hpp @@ -33,7 +33,7 @@ private: float xd8_padding = 10.f; u32 xdc_flags; // 0x2: flyer, 0x4: path-always-exists (swimmers) u32 xe0_indexMask; - mutable std::optional m_viz; + std::optional m_viz; bool Search(rstl::reserved_vector& regs1, const zeus::CVector3f& p1, rstl::reserved_vector& regs2, const zeus::CVector3f& p2); void GetSplinePoint(zeus::CVector3f& pOut, const zeus::CVector3f& p1, u32 wpIdx) const; @@ -61,7 +61,7 @@ public: void SetCharacterRadius(float r) { xd4_chRadius = r; } void SetPadding(float padding) { xd8_padding = padding; } float RemainingPathDistance(const zeus::CVector3f& pos) const; - void DebugDraw() const; + void DebugDraw(); }; } // namespace urde