From 737f95e5ddad09bf4b1986b54b1515df41f9711c Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sun, 13 Feb 2011 03:31:05 +0000 Subject: [PATCH] - for testing made max pathfinder nodecount configurable --- source/glest_game/ai/path_finder.cpp | 3 ++- source/glest_game/ai/path_finder.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) 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;