From bb2e2d0f641deb5f1e876ab4f69e56a6fd2fa65c Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sat, 9 Nov 2013 19:14:53 +0000 Subject: [PATCH] removed more unused code for last path cache which was already removed --- source/glest_game/ai/path_finder.cpp | 8 -------- source/glest_game/type_instances/unit.cpp | 11 ----------- source/glest_game/type_instances/unit.h | 1 - 3 files changed, 20 deletions(-) diff --git a/source/glest_game/ai/path_finder.cpp b/source/glest_game/ai/path_finder.cpp index 613a34a5..7002311d 100644 --- a/source/glest_game/ai/path_finder.cpp +++ b/source/glest_game/ai/path_finder.cpp @@ -662,10 +662,6 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout codeLocation = "14"; path->add(nodePos); } - if(basicPathFinder) { - codeLocation = "15"; - basicPathFinder->addToLastPathCache(nodePos); - } } codeLocation = "16"; unit->setUsePathfinderExtendedMaxNodes(false); @@ -1021,10 +1017,6 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout codeLocation = "58"; path->add(nodePos); } - if(basicPathFinder) { - codeLocation = "59"; - basicPathFinder->addToLastPathCache(nodePos); - } } } diff --git a/source/glest_game/type_instances/unit.cpp b/source/glest_game/type_instances/unit.cpp index b8b42a21..28f023a1 100644 --- a/source/glest_game/type_instances/unit.cpp +++ b/source/glest_game/type_instances/unit.cpp @@ -122,17 +122,6 @@ void UnitPathBasic::add(const Vec2i &path) { pathQueue.push_back(path); } -void UnitPathBasic::addToLastPathCache(const Vec2i &path) { - if(this->map != NULL) { - if(this->map->isInside(path) == false) { - throw megaglest_runtime_error("Invalid map path position = " + path.getString() + " map w x h = " + intToStr(map->getW()) + " " + intToStr(map->getH())); - } - else if(this->map->isInsideSurface(this->map->toSurfCoords(path)) == false) { - throw megaglest_runtime_error("Invalid map surface path position = " + path.getString() + " map surface w x h = " + intToStr(map->getSurfaceW()) + " " + intToStr(map->getSurfaceH())); - } - } -} - Vec2i UnitPathBasic::pop(bool removeFrontPos) { if(pathQueue.empty() == true) { throw megaglest_runtime_error("pathQueue.size() = " + intToStr(pathQueue.size())); diff --git a/source/glest_game/type_instances/unit.h b/source/glest_game/type_instances/unit.h index f782c38f..9fb671df 100644 --- a/source/glest_game/type_instances/unit.h +++ b/source/glest_game/type_instances/unit.h @@ -197,7 +197,6 @@ public: virtual void clearBlockCount() { blockCount = 0; } virtual void incBlockCount(); virtual void add(const Vec2i &path); - void addToLastPathCache(const Vec2i &path); Vec2i pop(bool removeFrontPos=true); virtual int getBlockCount() const { return blockCount; } virtual int getQueueCount() const { return (int)pathQueue.size(); }