From 5431e206b04077f091ccaa631171b2031a56961c Mon Sep 17 00:00:00 2001 From: kabou Date: Wed, 23 Feb 2022 17:39:33 +0100 Subject: [PATCH] Fix hopper breakage in get_item_group return value. In commit 55009c257e253c49dacf017e4bd56bc36aca2e10 that added vectors to mcl_composters, mcl_hoppers was accidentally patched with a unrelated change, updating it to get_item_group(). This mostly works, but in one particular case the semantics of the return value differs. Instead of returning 'nil' it returns '0'. That altered the evaluation of an if condition, breaking the abm that sucks in items. This commit fixes the conditional by explicitly comparing '~= 0'. --- mods/ITEMS/mcl_hoppers/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_hoppers/init.lua b/mods/ITEMS/mcl_hoppers/init.lua index 8245a0b26..87831490f 100644 --- a/mods/ITEMS/mcl_hoppers/init.lua +++ b/mods/ITEMS/mcl_hoppers/init.lua @@ -343,7 +343,7 @@ minetest.register_abm({ local abovenode = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}) if not minetest.registered_items[abovenode.name] then return end -- Don't bother checking item enties if node above is a container (should save some CPU) - if minetest.get_item_group(abovenode.name, "container") then + if minetest.get_item_group(abovenode.name, "container") ~= 0 then return end local meta = minetest.get_meta(pos)