Fix deployer sometimes destroying items
authorNovatux <nathanael.courant@laposte.net>
Sun, 8 Jun 2014 09:04:13 +0000 (11:04 +0200)
committerNovatux <nathanael.courant@laposte.net>
Sun, 8 Jun 2014 09:04:13 +0000 (11:04 +0200)
deployer.lua

index 40b5883b9cdcbb002e81a14beaf5977464a4250c..d0ef9f6bad872022acc97bb8b4d367af72256ea7 100644 (file)
@@ -95,7 +95,7 @@ local function deployer_on(pos, node)
                        local pointed_thing = {type="node", under=pos_under, above=pos_above}
                        local stack2
                        if minetest.registered_items[stack:get_name()] then
-                               stack2 = minetest.registered_items[stack:get_name()].on_place(stack, placer, pointed_thing)
+                               stack2 = minetest.registered_items[stack:get_name()].on_place(stack, placer, pointed_thing) or stack
                        end
                        --if minetest.setting_getbool("creative_mode") and not minetest.get_modpath("unified_inventory") then --infinite stacks ahoy!
                        --      stack2:take_item()