minor improvements

This commit is contained in:
Joachim Stolberg 2021-04-30 19:00:59 +02:00
parent 223a43204b
commit 1b8978326b
4 changed files with 7 additions and 1 deletions

View File

@ -78,7 +78,7 @@ local function del_pos(pos, player)
local meta = player:get_meta() local meta = player:get_meta()
local lPos = minetest.deserialize(meta:get_string("techage_forceload_blocks")) or {} local lPos = minetest.deserialize(meta:get_string("techage_forceload_blocks")) or {}
lPos = remove_list_elem(lPos, pos) lPos = remove_list_elem(lPos, pos)
player:set_string("techage_forceload_blocks", minetest.serialize(lPos)) meta:set_string("techage_forceload_blocks", minetest.serialize(lPos))
end end
local function get_pos_list(player) local function get_pos_list(player)

View File

@ -411,6 +411,10 @@ function NodeStates:keep_running(pos, nvm, val)
nvm.last_active = minetest.get_gametime() nvm.last_active = minetest.get_gametime()
end end
function NodeStates:trigger_state(pos, nvm)
nvm.last_active = minetest.get_gametime()
end
-- Start/stop node based on button events. -- Start/stop node based on button events.
-- if function returns false, no button was pressed -- if function returns false, no button was pressed
function NodeStates:state_button_event(pos, nvm, fields) function NodeStates:state_button_event(pos, nvm, fields)

View File

@ -87,6 +87,7 @@ techage.lua_ctlr.register_action("print", {
local pos = self.meta.pos local pos = self.meta.pos
text = tostring(text or "") text = tostring(text or "")
output(pos, text) output(pos, text)
--print("Lua: "..text)
end, end,
help = " $print(text)\n".. help = " $print(text)\n"..
" Send a text line to the output window.\n".. " Send a text line to the output window.\n"..

View File

@ -119,6 +119,7 @@ local function node_timer(pos, elapsed)
if techage.is_activeformspec(pos) then if techage.is_activeformspec(pos) then
M(pos):set_string("formspec", formspec(State, pos, nvm)) M(pos):set_string("formspec", formspec(State, pos, nvm))
end end
State:trigger_state(pos, nvm)
return true return true
end end