From baef56e95b2d0188b9d63d043f8146f782404eb6 Mon Sep 17 00:00:00 2001 From: Sergei Marochkin Date: Wed, 19 Oct 2016 10:58:57 +0300 Subject: [PATCH] Fix move path validation again --- src/CMovePath.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)