1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Pathfinding: change argument order for getPath and AUTO layer as default

This still need investigation, but likely most of external code shouldn't be aware of layers in order to work properly because only LAND and SAIL can be targeted and single tile can't have both of these layers.
This commit is contained in:
ArseniyShestakov
2015-11-02 11:14:32 +03:00
parent b8253206c7
commit 2b6e1498d2
6 changed files with 12 additions and 12 deletions

View File

@@ -532,7 +532,7 @@ const CGPathNode * CPathsInfo::getPathInfo(const int3 &tile, const EPathfindingL
return &nodes[tile.x][tile.y][tile.z][layer];
}
bool CPathsInfo::getPath(const int3 &dst, const EPathfindingLayer &layer, CGPath &out) const
bool CPathsInfo::getPath(CGPath &out, const int3 &dst, const EPathfindingLayer &layer) const
{
boost::unique_lock<boost::mutex> pathLock(pathMx);
@@ -556,7 +556,7 @@ int CPathsInfo::getDistance(const int3 &tile, const EPathfindingLayer &layer) co
boost::unique_lock<boost::mutex> pathLock(pathMx);
CGPath ret;
if(getPath(tile, layer, ret))
if(getPath(ret, tile, layer))
return ret.nodes.size();
else
return 255;