From c821fef3ad8c5ed1f8164ccb78b587a4ca1746f6 Mon Sep 17 00:00:00 2001 From: BuckarooBanzay Date: Tue, 14 Mar 2023 14:09:38 +0100 Subject: [PATCH] code tidy --- conditions.lua | 7 +------ placements/mapblock_lib.lua | 3 +-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/conditions.lua b/conditions.lua index 5598caf..0e167bd 100644 --- a/conditions.lua +++ b/conditions.lua @@ -98,12 +98,7 @@ function building_lib.check_condition_group(mapblock_pos1, mapblock_pos2, condit end end - while true do - local mapblock_pos = it() - if not mapblock_pos then - break - end - + for mapblock_pos in it do success, err = building_lib.check_condition_table(conditions, mapblock_pos) if not success then group_match = false diff --git a/placements/mapblock_lib.lua b/placements/mapblock_lib.lua index a411c6a..4cdcb27 100644 --- a/placements/mapblock_lib.lua +++ b/placements/mapblock_lib.lua @@ -33,8 +33,7 @@ building_lib.register_placement("mapblock_lib", { local iterator = mapblock_lib.pos_iterator(catalog_pos1, catalog_pos2) - local worker - worker = function() + local function worker() local catalog_pos = iterator() if not catalog_pos then return callback()