Fix hopper breakage in get_item_group return value.

In commit 55009c257e 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'.
This commit is contained in:
kabou 2022-02-23 17:39:33 +01:00 committed by cora
parent de929349b9
commit 178b929c6c
1 changed files with 1 additions and 1 deletions

View File

@ -343,7 +343,7 @@ minetest.register_abm({
local abovenode = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}) 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 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) -- 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 return
end end
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)