Index: source/simulation2/helpers/LongPathfinder.cpp =================================================================== --- source/simulation2/helpers/LongPathfinder.cpp +++ source/simulation2/helpers/LongPathfinder.cpp @@ -718,7 +718,9 @@ PROFILE2_IFSPIKE("ComputePathJPS", 0.0002); PathfinderState state = { 0 }; - if (m_UseJPSCache && m_JumpPointCache.find(passClass) == m_JumpPointCache.end()) + auto it = m_JumpPointCache.find(passClass); + state.jpc = it->second.get(); + if (m_UseJPSCache && !state.jpc) { state.jpc = new JumpPointCache; state.jpc->reset(m_Grid, passClass);