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 elexis, 9 years ago)
  • source/simulation2/components/CCmpPathfinder.cpp

    void CCmpPathfinder::UpdateGrid()  
    512512
    513513    // Add obstructions onto the grid
    514514    cmpObstructionManager->Rasterize(*m_Grid, m_PassClasses, m_ObstructionsDirty.globalRecompute);
    515515
    516516    // 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
    518519    {
    519520        std::map<std::string, pass_class_t> nonPathfindingPassClasses, pathfindingPassClasses;
    520521        GetPassabilityClasses(nonPathfindingPassClasses, pathfindingPassClasses);
    521522        m_LongPathfinder.Reload(m_Grid, nonPathfindingPassClasses, pathfindingPassClasses);
    522523    }
    523     else
    524         m_LongPathfinder.Update(m_Grid, m_ObstructionsDirty.dirtinessGrid);
     524    //else
     525    //  m_LongPathfinder.Update(m_Grid, m_ObstructionsDirty.dirtinessGrid);
    525526
    526527    // Notify the units that their current paths can be invalid now.
    527528    // The passability map will be globally dirty after init, or rejoining, loading a saved game, etc.
    528529    // In those situations the paths can't be invalid.
    529530    if (!m_ObstructionsDirty.globallyDirty)