فهرست منبع

CPathfinder: get rid of addNeighbours coord argument

ArseniyShestakov 10 سال پیش
والد
کامیت
d524b4eabe
2فایلهای تغییر یافته به همراه4 افزوده شده و 4 حذف شده
  1. 3 3
      lib/CPathfinder.cpp
  2. 1 1
      lib/CPathfinder.h

+ 3 - 3
lib/CPathfinder.cpp

@@ -107,7 +107,7 @@ void CPathfinder::calculatePaths()
 		}
 
 		//add accessible neighbouring nodes to the queue
-		addNeighbours(cp->coord);
+		addNeighbours();
 		for(auto & neighbour : neighbours)
 		{
 			dt = &gs->map->getTile(neighbour);
@@ -186,11 +186,11 @@ void CPathfinder::calculatePaths()
 	} //queue loop
 }
 
-void CPathfinder::addNeighbours(const int3 & coord)
+void CPathfinder::addNeighbours()
 {
 	neighbours.clear();
 	std::vector<int3> tiles;
-	CPathfinderHelper::getNeighbours(gs, *ct, coord, tiles, boost::logic::indeterminate, cp->layer == ELayer::SAIL); // TODO: find out if we still need "limitCoastSailing" option
+	CPathfinderHelper::getNeighbours(gs, *ct, cp->coord, tiles, boost::logic::indeterminate, cp->layer == ELayer::SAIL); // TODO: find out if we still need "limitCoastSailing" option
 	if(isSourceVisitableObj())
 	{
 		for(int3 tile: tiles)

+ 1 - 1
lib/CPathfinder.h

@@ -165,7 +165,7 @@ private:
 	const CGObjectInstance * ctObj, * dtObj;
 	CGPathNode::ENodeAction destAction;
 
-	void addNeighbours(const int3 & coord);
+	void addNeighbours();
 	void addTeleportExits();
 
 	bool isLayerTransitionPossible() const;