diff options
author | FaceDeer <derksenmobile@gmail.com> | 2017-10-22 19:48:28 -0600 |
---|---|---|
committer | FaceDeer <derksenmobile@gmail.com> | 2017-10-22 19:48:28 -0600 |
commit | 2949dbd76453a9a8fd49a5e52a5176cbf7fad25a (patch) | |
tree | 12c9c443540e5b5ceb5268c6aee76f12f9194e43 | |
parent | 94ccab9c391f0a08e9382220112a9546a108d3fd (diff) |
prevent crate from storing null Digtrons
-rw-r--r-- | nodes/node_crate.lua | 7 |
1 files changed, 7 insertions, 0 deletions
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()) |