Update config file after pruning at startup
This commit is contained in:
parent
fc20b379f9
commit
d35d7086a4
11
api.lua
11
api.lua
@ -571,7 +571,10 @@ end
|
||||
--- Prunes unknown items & updates aliases in shops.
|
||||
--
|
||||
-- @function server_shop.prune_shops
|
||||
ss.prune_shops = function()
|
||||
-- @tparam[opt] bool update_config
|
||||
ss.prune_shops = function(update_config)
|
||||
update_config = update_config == true
|
||||
|
||||
-- show warning if no currencies are registered
|
||||
if not ss.currency_is_registered() then
|
||||
ss.log("warning", "no currencies registered")
|
||||
@ -623,4 +626,10 @@ ss.prune_shops = function()
|
||||
ss.register(id, def.products, def.buyer)
|
||||
end
|
||||
end
|
||||
|
||||
if update_config then
|
||||
local shops_data = wdata.read("server_shops")
|
||||
shops_data.shops = shops
|
||||
wdata.write("server_shops", shops_data)
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user