From 50a7fe11dd586c66b18db4ac21a78455e4769797 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Wed, 23 Sep 2020 20:39:41 +0200 Subject: [PATCH] fix bug regarding single houses beeing ignored in some situations --- villages.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/villages.lua b/villages.lua index 706ef97..11aa469 100644 --- a/villages.lua +++ b/villages.lua @@ -930,8 +930,8 @@ mg_villages.houses_in_mapchunk = function( minp, mapchunk_size, villages ) local d = math.ceil( mapchunk_size / 2 ); for _,candidate in ipairs(village_candidates) do if( not( candidate.areas_intersect ) - and (candidate.vx > minp.x - d or candidate.vx < (mapchunk_size+d) ) - and (candidate.vz > minp.z - d or candidate.vz < (mapchunk_size+d) )) then + and (candidate.vx > minp.x - d or candidate.vx < (minp.x+mapchunk_size+d) ) + and (candidate.vz > minp.z - d or candidate.vz < (minp.z+mapchunk_size+d) )) then table.insert( villages, candidate ); -- there may be quite a lot of single houses added; plus they are less intresting than entire villages. Thus, logfile spam is reduced