1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Merge pull request #5304 from IvanSavenko/oneway_ai

Enable one-way monoliths for AI
This commit is contained in:
Ivan Savenko
2025-01-25 13:42:31 +02:00
committed by GitHub
38 changed files with 249 additions and 129 deletions

View File

@@ -1144,15 +1144,9 @@ void CGameState::apply(CPackForClient & pack)
pack.applyGs(this);
}
void CGameState::calculatePaths(const CGHeroInstance *hero, CPathsInfo &out)
void CGameState::calculatePaths(const std::shared_ptr<PathfinderConfig> & config) const
{
calculatePaths(std::make_shared<SingleHeroPathfinderConfig>(out, this, hero));
}
void CGameState::calculatePaths(const std::shared_ptr<PathfinderConfig> & config)
{
//FIXME: creating pathfinder is costly, maybe reset / clear is enough?
CPathfinder pathfinder(this, config);
CPathfinder pathfinder(const_cast<CGameState*>(this), config);
pathfinder.calculatePaths();
}