From 37e5097ea91084376973db482b606352aa52deb6 Mon Sep 17 00:00:00 2001 From: Itms Date: Tue, 4 Jun 2019 08:29:47 +0000 Subject: [PATCH] Fix a m_JumpPointCache assertion failure in debug mode, refs fa726867f1. Patch By: Stan Comments By: wraitii Differential Revision: https://code.wildfiregames.com/D1942 This was SVN commit r22336. --- source/simulation2/helpers/LongPathfinder.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/simulation2/helpers/LongPathfinder.cpp b/source/simulation2/helpers/LongPathfinder.cpp index aa6f202f50..bd1f9b1d2c 100644 --- a/source/simulation2/helpers/LongPathfinder.cpp +++ b/source/simulation2/helpers/LongPathfinder.cpp @@ -720,8 +720,9 @@ void LongPathfinder::ComputeJPSPath(const HierarchicalPathfinder& hierPath, enti PathfinderState state = { 0 }; std::map >::const_iterator it = m_JumpPointCache.find(passClass); - state.jpc = it->second.get(); - + if (it != m_JumpPointCache.end()) + state.jpc = it->second.get(); + if (m_UseJPSCache && !state.jpc) { state.jpc = new JumpPointCache;