diff options
author | James Stevenson <everamzah@gmail.com> | 2016-07-14 11:02:43 -0400 |
---|---|---|
committer | James Stevenson <everamzah@gmail.com> | 2016-07-14 11:02:43 -0400 |
commit | 34676b7aae77429b7a2a727e6208132fa01e225f (patch) | |
tree | 217a1936ca78d71625463ad493627f4c6731eda3 | |
parent | 478015c563f8ebdd9e4c7d8621b784028b5880ee (diff) | |
download | mailbox-34676b7aae77429b7a2a727e6208132fa01e225f.tar.gz mailbox-34676b7aae77429b7a2a727e6208132fa01e225f.tar.bz2 mailbox-34676b7aae77429b7a2a727e6208132fa01e225f.zip |
Thank you Krock!
-rw-r--r-- | init.lua | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -32,12 +32,13 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if fields.books_only then local pos = minetest.string_to_pos(formname:sub(17)) - if minetest.get_node(pos).name == "mailbox:mailbox" then - minetest.swap_node(pos, - {name = "mailbox:letterbox"}) + local node = minetest.get_node(pos) + if node.name == "mailbox:mailbox" then + node.name = "mailbox:letterbox" + minetest.swap_node(pos, node) else - minetest.swap_node(pos, - {name = "mailbox:mailbox"}) + node.name = "mailbox:mailbox" + minetest.swap_node(pos, node) end end end) |