From 2949dbd76453a9a8fd49a5e52a5176cbf7fad25a Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Sun, 22 Oct 2017 19:48:28 -0600 Subject: prevent crate from storing null Digtrons --- nodes/node_crate.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nodes/node_crate.lua b/nodes/node_crate.lua index dc035b2..b0a5741 100644 --- a/nodes/node_crate.lua +++ b/nodes/node_crate.lua @@ -25,6 +25,13 @@ minetest.register_node("digtron:empty_crate", { -- no stealing other peoples' digtrons return end + + if #layout.all == 1 then + local meta = minetest.get_meta(pos) + minetest.sound_play("buzzer", {gain=0.5, pos=pos}) + meta:set_string("infotext", S("No Digtron components adjacent to package")) + return + end digtron.award_crate(layout, clicker:get_player_name()) -- cgit v1.2.3