From 73183a5a3653fc1d10664c16e6e068e951b64142 Mon Sep 17 00:00:00 2001 From: Hybrid Dog Date: Thu, 29 Dec 2016 12:14:35 +0100 Subject: [PATCH] support node timer interval which is not 1 second M maidroid_tool/api.lua --- maidroid_tool/api.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maidroid_tool/api.lua b/maidroid_tool/api.lua index ba5ccd4..2282160 100644 --- a/maidroid_tool/api.lua +++ b/maidroid_tool/api.lua @@ -39,7 +39,7 @@ function maidroid_tool.register_writer(nodename, options) end -- on_timer is a common callback. - local function on_timer(pos) + local function on_timer(pos, elapsed) local meta = minetest.get_meta(pos) local inventory = meta:get_inventory() local main_list = inventory:get_list("main") @@ -52,7 +52,7 @@ function maidroid_tool.register_writer(nodename, options) -- if time is positive, this node is active. if time >= 0 then if time <= duration then - meta:set_float("time", time + 1) + meta:set_float("time", time + elapsed) meta:set_string("formspec", formspec.active(time)) else meta:set_float("time", -1)