1
0
forked from mirrors/0ad

JPS - make the JPC cache usable again (98f4ed6cb8 fix)

Reviewed By: Itms
Differential Revision: https://code.wildfiregames.com/D1875
This was SVN commit r22301.
This commit is contained in:
wraitii
2019-05-25 16:01:44 +00:00
parent 537a141867
commit 220449ea9a
@@ -719,7 +719,10 @@ void LongPathfinder::ComputeJPSPath(const HierarchicalPathfinder& hierPath, enti
PROFILE2_IFSPIKE("ComputePathJPS", 0.0002);
PathfinderState state = { 0 };
if (m_UseJPSCache && m_JumpPointCache.find(passClass) == m_JumpPointCache.end())
std::map<pass_class_t, shared_ptr<JumpPointCache> >::const_iterator 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);