mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-05 00:49:09 +02:00
Fix broken roads to portals or gates by the lower zone border
This commit is contained in:
@ -24,13 +24,13 @@
|
||||
|
||||
VCMI_LIB_NAMESPACE_BEGIN
|
||||
|
||||
void replaceWithCurvedPath(rmg::Path & path, const Zone & zone, const int3 & src)
|
||||
void replaceWithCurvedPath(rmg::Path & path, const Zone & zone, const int3 & src, bool onlyStraight)
|
||||
{
|
||||
auto costFunction = rmg::Path::createCurvedCostFunction(zone.area()->getBorder());
|
||||
auto pathArea = zone.areaForRoads();
|
||||
rmg::Path curvedPath(pathArea);
|
||||
curvedPath.connect(zone.freePaths().get());
|
||||
curvedPath = curvedPath.search(src, false, costFunction);
|
||||
curvedPath = curvedPath.search(src, onlyStraight, costFunction);
|
||||
if (curvedPath.valid())
|
||||
{
|
||||
path = curvedPath;
|
||||
|
Reference in New Issue
Block a user