mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Merge pull request #534 from nullkiller/ai-fix-crash-in-pathfinding-static-storage
AI: fix crash in pathfinding
This commit is contained in:
commit
05c9b3e2f9
@ -28,6 +28,13 @@ void AIPathfinder::clear()
|
||||
storageMap.clear();
|
||||
}
|
||||
|
||||
void AIPathfinder::init()
|
||||
{
|
||||
boost::unique_lock<boost::mutex> storageLock(storageMutex);
|
||||
storagePool.clear();
|
||||
storageMap.clear();
|
||||
}
|
||||
|
||||
std::vector<AIPath> AIPathfinder::getPathInfo(HeroPtr hero, int3 tile)
|
||||
{
|
||||
boost::unique_lock<boost::mutex> storageLock(storageMutex);
|
||||
|
@ -27,4 +27,5 @@ public:
|
||||
AIPathfinder(CPlayerSpecificInfoCallback * cb, VCAI * ai);
|
||||
std::vector<AIPath> getPathInfo(HeroPtr hero, int3 tile);
|
||||
void clear();
|
||||
void init();
|
||||
};
|
||||
|
@ -24,6 +24,7 @@ void PathfindingManager::init(CPlayerSpecificInfoCallback * CB)
|
||||
{
|
||||
cb = CB;
|
||||
pathfinder.reset(new AIPathfinder(cb, ai));
|
||||
pathfinder->init();
|
||||
}
|
||||
|
||||
void PathfindingManager::setAI(VCAI * AI)
|
||||
|
Loading…
Reference in New Issue
Block a user