mirror of
https://codeberg.org/usrib/emeraldbank.git
synced 2024-08-18 20:34:04 +02:00
swap_shop func fix
This commit is contained in:
parent
41fa30ee22
commit
1b19afc799
8
shop.lua
8
shop.lua
@ -86,7 +86,7 @@ local function swap_shop(pos, closed)
|
||||
local oldnode = core.get_node(pos)
|
||||
local oldnodemeta = core.get_meta(pos):to_table()
|
||||
local nodename = core.get_node(pos).name
|
||||
if nodename == "emeraldbank:shop" and closed then
|
||||
if closed then
|
||||
core.swap_node(pos, {name = "emeraldbank:shop_empty"})
|
||||
else
|
||||
core.swap_node(pos, {name = "emeraldbank:shop"})
|
||||
@ -153,7 +153,7 @@ local function on_rightclick(pos, node, clicker, itemstack)
|
||||
local owner = meta:get_string("owner")
|
||||
local pname = clicker:get_player_name()
|
||||
get_stonks(pos, clicker)
|
||||
--if nodename == "emeraldbank:shop" and pname == owner then
|
||||
--if nodename == "emeraldbank:shop" or pname == owner then
|
||||
core.show_formspec(pname, formspec_prefix..core.pos_to_string(pos), emeraldbank.get_shop_fs(pos, clicker) )
|
||||
--end
|
||||
end
|
||||
@ -163,14 +163,12 @@ local function on_punch(pos, node, puncher, pointed_thing)
|
||||
end
|
||||
|
||||
local function on_metadata_inventory_put(pos, listname, index, stack, player)
|
||||
set_item(pos, stack, player)
|
||||
set_item(pos, stack, player) -- this func already show the fs
|
||||
check_empty(pos)
|
||||
--core.show_formspec(player:get_player_name(), formspec_prefix..core.pos_to_string(pos), emeraldbank.get_shop_fs(pos, player) )
|
||||
end
|
||||
|
||||
local function on_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
check_empty(pos)
|
||||
--core.show_formspec(player:get_player_name(), formspec_prefix..core.pos_to_string(pos), emeraldbank.get_shop_fs(pos, player) )
|
||||
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user