- for testing made max pathfinder nodecount configurable

This commit is contained in:
Mark Vejvoda 2011-02-13 03:31:05 +00:00
parent 4488a4d388
commit 737f95e5dd
2 changed files with 3 additions and 2 deletions

View File

@ -39,7 +39,7 @@ namespace Glest{ namespace Game{
const int PathFinder::maxFreeSearchRadius = 10; const int PathFinder::maxFreeSearchRadius = 10;
//const int PathFinder::pathFindNodesMax= 400; //const int PathFinder::pathFindNodesMax= 400;
const int PathFinder::pathFindNodesMax = 1000; int PathFinder::pathFindNodesMax = 1000;
const int PathFinder::pathFindRefresh = 20; const int PathFinder::pathFindRefresh = 20;
const int PathFinder::pathFindBailoutRadius = 20; const int PathFinder::pathFindBailoutRadius = 20;
@ -57,6 +57,7 @@ PathFinder::PathFinder(const Map *map) {
} }
void PathFinder::init(const Map *map) { void PathFinder::init(const Map *map) {
PathFinder::pathFindNodesMax = Config::getInstance().getInt("MaxPathfinderNodeCount",intToStr(PathFinder::pathFindNodesMax).c_str());
nodePool.resize(pathFindNodesMax); nodePool.resize(pathFindNodesMax);
this->map= map; this->map= map;
} }

View File

@ -54,7 +54,7 @@ public:
public: public:
static const int maxFreeSearchRadius; static const int maxFreeSearchRadius;
static const int pathFindNodesMax; static int pathFindNodesMax;
static const int pathFindRefresh; static const int pathFindRefresh;
static const int pathFindBailoutRadius; static const int pathFindBailoutRadius;