Ticket #3538: t3538_recompute_hierarchichal_pathfinder_every_turn_WIP_v1.patch
File t3538_recompute_hierarchichal_pathfinder_every_turn_WIP_v1.patch, 1.3 KB (added by , 9 years ago) |
---|
-
source/simulation2/components/CCmpPathfinder.cpp
void CCmpPathfinder::UpdateGrid() 512 512 513 513 // Add obstructions onto the grid 514 514 cmpObstructionManager->Rasterize(*m_Grid, m_PassClasses, m_ObstructionsDirty.globalRecompute); 515 515 516 516 // Update the long-range pathfinder 517 if (m_ObstructionsDirty.globallyDirty) 517 // When adding a new obstruction, the hierarchichal pathfinder needs a recompute. 518 //if (m_ObstructionsDirty.globallyDirty) TODO 518 519 { 519 520 std::map<std::string, pass_class_t> nonPathfindingPassClasses, pathfindingPassClasses; 520 521 GetPassabilityClasses(nonPathfindingPassClasses, pathfindingPassClasses); 521 522 m_LongPathfinder.Reload(m_Grid, nonPathfindingPassClasses, pathfindingPassClasses); 522 523 } 523 else524 m_LongPathfinder.Update(m_Grid, m_ObstructionsDirty.dirtinessGrid);524 //else 525 // m_LongPathfinder.Update(m_Grid, m_ObstructionsDirty.dirtinessGrid); 525 526 526 527 // Notify the units that their current paths can be invalid now. 527 528 // The passability map will be globally dirty after init, or rejoining, loading a saved game, etc. 528 529 // In those situations the paths can't be invalid. 529 530 if (!m_ObstructionsDirty.globallyDirty)