From 4112a85906f4dc5f55693c0f444a797a2cf80bcb Mon Sep 17 00:00:00 2001 From: Jett <55758076+Jettford@users.noreply.github.com> Date: Fri, 5 Aug 2022 13:41:07 +0100 Subject: [PATCH] Fix checks for if the physics world is loaded (#711) --- dNavigation/dNavMesh.h | 3 +++ dPhysics/dpWorld.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dNavigation/dNavMesh.h b/dNavigation/dNavMesh.h index 09e9c895..dc3db854 100644 --- a/dNavigation/dNavMesh.h +++ b/dNavigation/dNavMesh.h @@ -17,6 +17,9 @@ public: float GetHeightAtPoint(const NiPoint3& location); std::vector GetPath(const NiPoint3& startPos, const NiPoint3& endPos, float speed = 10.0f); + + class dtNavMesh* GetdtNavMesh() { return m_NavMesh; } + private: void LoadNavmesh(); diff --git a/dPhysics/dpWorld.h b/dPhysics/dpWorld.h index 3878cd12..45e550cb 100644 --- a/dPhysics/dpWorld.h +++ b/dPhysics/dpWorld.h @@ -24,7 +24,7 @@ public: ~dpWorld(); bool ShouldUseSP(unsigned int zoneID); - bool IsLoaded() const { return m_NavMesh != nullptr; } + bool IsLoaded() const { return m_NavMesh->GetdtNavMesh() != nullptr; } void StepWorld(float deltaTime);