1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Merge pull request #4223 from vcmi/more_diagonal_roads

Route roads even further away from zone boundary
This commit is contained in:
Ivan Savenko 2024-07-05 15:45:28 +03:00 committed by GitHub
commit 5f3394176c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -87,8 +87,8 @@ bool RoadPlacer::createRoad(const int3 & destination)
{
ret *= VISITABLE_PENALTY;
}
float dist = border.distance(dst);
if(dist > 1)
float dist = border.distanceSqr(dst);
if(dist > 1.0f)
{
ret /= dist;
}