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 committed 2015-11-02 11:14:32 +03:00
1 parent b8253206c7
commit 2b6e1498d2
6 files changed
+12 -12

No files matched your search

+1 -1
View File
@@ -372,7 +372,7 @@ int3 whereToExplore(HeroPtr h)
{
int3 op = obj->visitablePos();
CGPath p;
ai->myCb->getPathsInfo(h.get())->getPath(op, p);
ai->myCb->getPathsInfo(h.get())->getPath(p, ops);
if (p.nodes.size() && p.endPos() == op && p.nodes.size() <= DIST_LIMIT)
if (ai->isGoodForVisit(obj, h, sm))
nearbyVisitableObjs.push_back(obj);
+2 -2
View File
@@ -1840,7 +1840,7 @@ bool VCAI::moveHeroToTile(int3 dst, HeroPtr h)
else
{
CGPath path;
cb->getPathsInfo(h.get())->getPath(dst, path);
cb->getPathsInfo(h.get())->getPath(path, dst);
if(path.nodes.empty())
{
logAi->errorStream() << "Hero " << h->name << " cannot reach " << dst;
@@ -2519,7 +2519,7 @@ int3 VCAI::explorationNewPoint(HeroPtr h)
continue;
CGPath path;
cb->getPathsInfo(hero)->getPath(tile, path);
cb->getPathsInfo(hero)->getPath(path, tile);
float ourValue = (float)howManyTilesWillBeDiscovered(tile, radius, cbp) / (path.nodes.size() + 1); //+1 prevents erratic jumps
if (ourValue > bestValue) //avoid costly checks of tiles that don't reveal much