From 319f289dc4acbb43c366c06b12f5bc64c54c593f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Zieli=C5=84ski?= Date: Mon, 10 Apr 2023 10:00:24 +0200 Subject: [PATCH] Fix distance check --- lib/rmg/CZonePlacer.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/rmg/CZonePlacer.cpp b/lib/rmg/CZonePlacer.cpp index 77ee31ab5..dc07af63a 100644 --- a/lib/rmg/CZonePlacer.cpp +++ b/lib/rmg/CZonePlacer.cpp @@ -306,15 +306,14 @@ void CZonePlacer::placeOnGrid(CRandomGenerator* rand) } distance += localDistance; - - if (distance > maxDistance) - { - distance = maxDistance; - mostDistantPlace = potentialPos; - } } } } + if (distance > maxDistance) + { + maxDistance = distance; + mostDistantPlace = potentialPos; + } } } }