1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Fix for sealed-off treasures (#771)

Fix for sealer-off treasures
This commit is contained in:
Nordsoft91
2022-08-09 16:12:58 +04:00
committed by Andrii Danylchenko
parent 4bd0ff680a
commit 2edf9ef3a4

View File

@@ -155,7 +155,7 @@ rmg::Path Zone::searchPath(const rmg::Area & src, bool onlyStraight, std::functi
}; };
auto area = (dAreaPossible + dAreaFree).getSubarea(areafilter); auto area = (dAreaPossible + dAreaFree).getSubarea(areafilter);
rmg::Path freePath(area); rmg::Path freePath(area), resultPath(area);
freePath.connect(dAreaFree); freePath.connect(dAreaFree);
//connect to all pieces //connect to all pieces
@@ -167,9 +167,10 @@ rmg::Path Zone::searchPath(const rmg::Area & src, bool onlyStraight, std::functi
return rmg::Path::invalid(); return rmg::Path::invalid();
freePath.connect(path.getPathArea()); freePath.connect(path.getPathArea());
resultPath.connect(path.getPathArea());
} }
return freePath; return resultPath;
} }
rmg::Path Zone::searchPath(const int3 & src, bool onlyStraight, std::function<bool(const int3 &)> areafilter) const rmg::Path Zone::searchPath(const int3 & src, bool onlyStraight, std::function<bool(const int3 &)> areafilter) const