From 98f4ed6cb834dade0bdf459b2538f858ac211db7 Mon Sep 17 00:00:00 2001 From: wraitii Date: Thu, 25 Apr 2019 07:08:19 +0000 Subject: [PATCH] Fix D1491 which introduced an ENSURE that should not have been there. Reported by wowgetoffyourcellphone. This was SVN commit r22225. --- source/simulation2/helpers/LongPathfinder.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/source/simulation2/helpers/LongPathfinder.cpp b/source/simulation2/helpers/LongPathfinder.cpp index 8c842fafca..303e913e89 100644 --- a/source/simulation2/helpers/LongPathfinder.cpp +++ b/source/simulation2/helpers/LongPathfinder.cpp @@ -718,11 +718,7 @@ void LongPathfinder::ComputeJPSPath(entity_pos_t x0, entity_pos_t z0, const Path PROFILE2_IFSPIKE("ComputePathJPS", 0.0002); PathfinderState state = { 0 }; - auto it = m_JumpPointCache.find(passClass); - ENSURE(it != m_JumpPointCache.end()); - state.jpc = it->second.get(); - - if (m_UseJPSCache && !state.jpc) + if (m_UseJPSCache && m_JumpPointCache.find(passClass) == m_JumpPointCache.end()) { state.jpc = new JumpPointCache; state.jpc->reset(m_Grid, passClass);