summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2018-09-10 21:23:29 +0200
committerLinus Jahn <lnj@kaidan.im>2018-09-10 21:23:29 +0200
commit8702b6ac927342043697f3930fa14b96131ab3b5 (patch)
tree7e6c45fe41d21e232f0e34654c04190285ba860f
parentd8e1d83fd6a6db04fdc96bc77e5018d2c3f8345e (diff)
Make drawer controller update interval configurable
-rw-r--r--lua/controller.lua4
-rw-r--r--settingtypes.txt1
2 files changed, 4 insertions, 1 deletions
diff --git a/lua/controller.lua b/lua/controller.lua
index 6582c78..e36ff71 100644
--- a/lua/controller.lua
+++ b/lua/controller.lua
@@ -43,6 +43,8 @@ Controllers that have no items will not continue scanning drawers. ]]--
local MP = core.get_modpath(core.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
+local controller_interval = tonumber(core.setting_get("drawers_controller_interval"))
+
local function controller_can_dig(pos, player)
local meta = core.get_meta(pos);
local inv = meta:get_inventory()
@@ -356,7 +358,7 @@ controller_def.on_construct = function(pos)
meta:set_string("drawers_table_index", "")
meta:set_string("formspec", controller_formspec(pos, S("Running")))
local timer = core.get_node_timer(pos)
- timer:start(7)
+ timer:start(controller_interval)
end
controller_def.on_blast = function(pos)
local drops = {}
diff --git a/settingtypes.txt b/settingtypes.txt
new file mode 100644
index 0000000..8175c15
--- /dev/null
+++ b/settingtypes.txt
@@ -0,0 +1 @@
+drawers_controller_interval (Drawer Controller update interval in seconds) float 7.0 0.1 10.0