get_node_drops: Make empty drop return empty table (#7592)
authortenplus1 <tenplus1@users.noreply.github.com>
Thu, 30 Aug 2018 18:32:33 +0000 (19:32 +0100)
committerSmallJoker <SmallJoker@users.noreply.github.com>
Thu, 30 Aug 2018 18:32:33 +0000 (20:32 +0200)
This stops get_node_drops from returning an empty string when using drop = "" and instead returns the supposed empty table instead {}

builtin/game/item.lua

index 591531db0b4b9e145b1dceb67b680ac8809aee54..9b7569c774de1791d37abe62b8d124d633decb3f 100644 (file)
@@ -197,7 +197,7 @@ function core.get_node_drops(node, toolname)
                return {nodename}
        elseif type(drop) == "string" then
                -- itemstring drop
-               return {drop}
+               return drop ~= "" and {drop} or {}
        elseif drop.items == nil then
                -- drop = {} to disable default drop
                return {}