1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-03-23 21:29:13 +02:00

Cut straight paths for better passability

This commit is contained in:
Tomasz Zieliński 2024-03-20 10:03:26 +01:00
parent 25a62b504f
commit 662bb0d1f6

View File

@ -339,7 +339,7 @@ void Zone::fractalize()
Lock lock(areaMutex); Lock lock(areaMutex);
//Connect with free areas //Connect with free areas
auto areas = connectedAreas(clearedTiles, false); auto areas = connectedAreas(clearedTiles, true);
for(auto & area : areas) for(auto & area : areas)
{ {
if(dAreaFree.overlap(area)) if(dAreaFree.overlap(area))
@ -348,7 +348,7 @@ void Zone::fractalize()
auto availableArea = dAreaPossible + dAreaFree; auto availableArea = dAreaPossible + dAreaFree;
rmg::Path path(availableArea); rmg::Path path(availableArea);
path.connect(dAreaFree); path.connect(dAreaFree);
auto res = path.search(area, false); auto res = path.search(area, true);
if(res.getPathArea().empty()) if(res.getPathArea().empty())
{ {
dAreaPossible.subtract(area); dAreaPossible.subtract(area);