diff --git a/src/CMovePath.cpp b/src/CMovePath.cpp index c8ac542..494dbfe 100644 --- a/src/CMovePath.cpp +++ b/src/CMovePath.cpp @@ -28,7 +28,7 @@ bool CMovePath::Destroy(int iPathId) bool CMovePath::IsPathValid(int iPathId) { - return static_cast(m_vPath.size()) < iPathId; + return iPathId >= 0 && static_cast(m_vPath.size()) > iPathId; } std::vector *CMovePath::GetPoints(int iPathId) @@ -60,7 +60,7 @@ bool CMovePath::IsPointValid(int iPathId, int iPointId) if (!IsPathValid(iPathId)) { return false; } - return static_cast(m_vPath[iPathId].size()) < iPointId; + return iPointId >= 0 && static_cast(m_vPath[iPathId].size()) > iPointId; } CVector *CMovePath::GetPoint(int iPathId, int iPointId)