From 00fd907ecb41873d7179f86c18a1a8e91c1a0b66 Mon Sep 17 00:00:00 2001 From: jp Date: Mon, 3 Aug 2015 13:28:46 +0200 Subject: [PATCH] Oops, bugfixes --- enchanting.lua | 2 +- mailbox.lua | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/enchanting.lua b/enchanting.lua index 9b4d2fa..433360b 100644 --- a/enchanting.lua +++ b/enchanting.lua @@ -26,7 +26,7 @@ local function enchfields(pos, formname, fields, sender) local enchs = {"durable", "fast"} for _, e in pairs(enchs) do - if mese > 0 and fields[e] then + if toolname ~= "" and mese > 0 and fields[e] then toolstack:replace("xdecor:enchanted_"..string.sub(toolname, 9).."_"..e) mesestack:take_item() inv:set_stack("mese", 1, mesestack) diff --git a/mailbox.lua b/mailbox.lua index 9af0a40..4f72ddb 100644 --- a/mailbox.lua +++ b/mailbox.lua @@ -19,14 +19,14 @@ xdecor.register("mailbox", { end, on_rightclick = function(pos, node, clicker, itemstack) local meta = minetest.get_meta(pos) - local player = clicker:get_player_name() + local playername = clicker:get_player_name() local owner = meta:get_string("owner") local meta = minetest.get_meta(pos) if owner == player then - minetest.show_formspec(player, "default:chest_locked", + minetest.show_formspec(playername, "default:chest_locked", xdecor.get_mailbox_formspec(pos)) - else minetest.show_formspec(player, "default:chest_locked", + else minetest.show_formspec(playername, "default:chest_locked", xdecor.get_mailbox_insert_formspec(pos)) end end, @@ -34,9 +34,9 @@ xdecor.register("mailbox", { local meta = minetest.get_meta(pos) local owner = meta:get_string("owner") local inv = meta:get_inventory() - local player = clicker:get_player_name() + local playername = player:get_player_name() - return player == owner and inv:is_empty("main") + return playername == owner and inv:is_empty("main") end, on_metadata_inventory_put = function(pos, listname, index, stack, player) local meta = minetest.get_meta(pos)