mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-19 21:10:12 +02:00
Cut straight paths for better passability
This commit is contained in:
parent
25a62b504f
commit
662bb0d1f6
@ -339,7 +339,7 @@ void Zone::fractalize()
|
||||
|
||||
Lock lock(areaMutex);
|
||||
//Connect with free areas
|
||||
auto areas = connectedAreas(clearedTiles, false);
|
||||
auto areas = connectedAreas(clearedTiles, true);
|
||||
for(auto & area : areas)
|
||||
{
|
||||
if(dAreaFree.overlap(area))
|
||||
@ -348,7 +348,7 @@ void Zone::fractalize()
|
||||
auto availableArea = dAreaPossible + dAreaFree;
|
||||
rmg::Path path(availableArea);
|
||||
path.connect(dAreaFree);
|
||||
auto res = path.search(area, false);
|
||||
auto res = path.search(area, true);
|
||||
if(res.getPathArea().empty())
|
||||
{
|
||||
dAreaPossible.subtract(area);
|
||||
|
Loading…
x
Reference in New Issue
Block a user