summaryrefslogtreecommitdiff
path: root/mesecons/actionqueue.lua
diff options
context:
space:
mode:
authorJeija <jeija@mesecons.net>2014-11-22 22:09:26 +0100
committerJeija <jeija@mesecons.net>2014-11-22 22:09:26 +0100
commitf977ac821aa2f6c7053ec7f65d289c57de1e91a8 (patch)
tree2d025fd6483e1ac3e4c409a356d2015aada00778 /mesecons/actionqueue.lua
parent80d136125ef8f17af85d0045800d5e761ace3229 (diff)
downloadmesecons-f977ac821aa2f6c7053ec7f65d289c57de1e91a8.tar
mesecons-f977ac821aa2f6c7053ec7f65d289c57de1e91a8.tar.gz
mesecons-f977ac821aa2f6c7053ec7f65d289c57de1e91a8.tar.bz2
mesecons-f977ac821aa2f6c7053ec7f65d289c57de1e91a8.tar.xz
mesecons-f977ac821aa2f6c7053ec7f65d289c57de1e91a8.zip
Re-implement settings system:
Settings can now be retrieved by mesecon.setting(<name>, <default>) and can be modified without editing the source code by adding the setting to minetest.conf For instance, you can add mesecon.blinky_plant_interval = 0.5 to minetest.conf in order to increase the blinking speed. Rewrite the blinky plant with nodetimers. Fixes #161
Diffstat (limited to 'mesecons/actionqueue.lua')
-rw-r--r--mesecons/actionqueue.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesecons/actionqueue.lua b/mesecons/actionqueue.lua
index 87fcee4..fa4079f 100644
--- a/mesecons/actionqueue.lua
+++ b/mesecons/actionqueue.lua
@@ -57,9 +57,12 @@ local get_highest_priority = function (actions)
end
local m_time = 0
+local resumetime = mesecon.setting("resumetime", 4)
minetest.register_globalstep(function (dtime)
m_time = m_time + dtime
- if (m_time < MESECONS_RESUMETIME) then return end -- don't even try if server has not been running for XY seconds
+ -- don't even try if server has not been running for XY seconds; resumetime = time to wait
+ -- after starting the server before processing the ActionQueue, don't set this too low
+ if (m_time < resumetime) then return end
local actions = mesecon.tablecopy(mesecon.queue.actions)
local actions_now={}