mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +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:
@@ -1288,7 +1288,7 @@ template <typename Handler> void CPlayerInterface::serializeTempl( Handler &h, c
|
||||
for(auto &p : pathsMap)
|
||||
{
|
||||
CGPath path;
|
||||
cb->getPathsInfo(p.first)->getPath(p.second, path);
|
||||
cb->getPathsInfo(p.first)->getPath(path, p.second);
|
||||
paths[p.first] = path;
|
||||
logGlobal->traceStream() << boost::format("Restored path for hero %s leading to %s with %d nodes")
|
||||
% p.first->nodeName() % p.second % path.nodes.size();
|
||||
@@ -2226,7 +2226,7 @@ CGPath * CPlayerInterface::getAndVerifyPath(const CGHeroInstance * h)
|
||||
{
|
||||
assert(h->getPosition(false) == path.startPos());
|
||||
//update the hero path in case of something has changed on map
|
||||
if(LOCPLINT->cb->getPathsInfo(h)->getPath(path.endPos(), path))
|
||||
if(LOCPLINT->cb->getPathsInfo(h)->getPath(path, path.endPos()))
|
||||
return &path;
|
||||
else
|
||||
paths.erase(h);
|
||||
|
Reference in New Issue
Block a user