Oops, bugfixes

This commit is contained in:
jp 2015-08-03 13:28:46 +02:00
parent b14b4684ce
commit 00fd907ecb
2 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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)