diff --git a/fancyshop.lua b/fancyshop.lua index a0fedc5..5614eae 100644 --- a/fancyshop.lua +++ b/fancyshop.lua @@ -1673,9 +1673,21 @@ if old_vendor_mods_table["emeraldbank"] then local nodename = core.get_node(pos).name local owner = meta:get_string("owner") local pname = clicker:get_player_name() + core.get_node_timer(pos):start(shop_timer) emeraldbank.get_stonks(pos, clicker) core.show_formspec(pname, formspec_prefix..core.pos_to_string(pos), emeraldbank.get_shop_fs(pos, clicker)) end + emeraldbank_template.on_timer = function(pos, elapsed) + local meta = core.get_meta(pos) + local owner = meta:get_string("owner") + local is_online = core.player_exists(owner) + core.get_node_timer(pos):start(shop_timer) + if is_online then + local player = core.get_player_by_name(owner) + if not player or player.is_fake_player then return end + emeraldbank.get_stonks(pos, player) + end + end minetest.override_item("emeraldbank:shop", emeraldbank_template) table.insert(clear_craft_vendors, "emeraldbank:shop") minetest.override_item("emeraldbank:shop_empty", emeraldbank_template)