From d5556ab964b679328da1712e4643a4549b764ae5 Mon Sep 17 00:00:00 2001 From: Paul Ouellette Date: Sat, 19 Jan 2019 01:37:00 -0500 Subject: [PATCH] Use # instead of next for array tables --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 6056570..09d2d83 100644 --- a/init.lua +++ b/init.lua @@ -363,7 +363,7 @@ local function make_formspec(player_name) ",0.12;0.8,0.8;craftguide_next_icon.png;next;]" fs[#fs + 1] = "field[0.3,0.32;2.5,1;filter;;" .. mt.formspec_escape(data.filter) .. "]" - if not next(data.items) then + if #data.items == 0 then fs[#fs + 1] = fmt("label[%f,%f;%s]", (data.iX / 2) - 1, 2, @@ -713,7 +713,7 @@ local function on_receive_fields(player, fields) recipes = apply_progressive_filters(recipes, player) end - if not next(recipes) then + if #recipes == 0 then return end end @@ -892,7 +892,7 @@ if not progressive_mode then if is_fuel and no_recipes then recipes = get_item_usages(node_name) - if next(recipes) then + if #recipes > 0 then data.show_usages = true end end