diff --git a/source/glest_game/ai/path_finder.cpp b/source/glest_game/ai/path_finder.cpp index a00558b5..5cebafda 100644 --- a/source/glest_game/ai/path_finder.cpp +++ b/source/glest_game/ai/path_finder.cpp @@ -39,7 +39,7 @@ namespace Glest{ namespace Game{ const int PathFinder::maxFreeSearchRadius = 10; //const int PathFinder::pathFindNodesMax= 400; -const int PathFinder::pathFindNodesMax = 1000; +int PathFinder::pathFindNodesMax = 1000; const int PathFinder::pathFindRefresh = 20; const int PathFinder::pathFindBailoutRadius = 20; @@ -57,6 +57,7 @@ PathFinder::PathFinder(const Map *map) { } void PathFinder::init(const Map *map) { + PathFinder::pathFindNodesMax = Config::getInstance().getInt("MaxPathfinderNodeCount",intToStr(PathFinder::pathFindNodesMax).c_str()); nodePool.resize(pathFindNodesMax); this->map= map; } diff --git a/source/glest_game/ai/path_finder.h b/source/glest_game/ai/path_finder.h index 57caa94a..41c9b4d7 100644 --- a/source/glest_game/ai/path_finder.h +++ b/source/glest_game/ai/path_finder.h @@ -54,7 +54,7 @@ public: public: static const int maxFreeSearchRadius; - static const int pathFindNodesMax; + static int pathFindNodesMax; static const int pathFindRefresh; static const int pathFindBailoutRadius;