|
|
@@ -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;
|