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 lPos = minetest.deserialize(meta:get_string("techage_forceload_blocks")) or {}
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
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()
end
function NodeStates:trigger_state(pos, nvm)
nvm.last_active = minetest.get_gametime()
end
-- Start/stop node based on button events.
-- if function returns false, no button was pressed
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
text = tostring(text or "")
output(pos, text)
--print("Lua: "..text)
end,
help = " $print(text)\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
M(pos):set_string("formspec", formspec(State, pos, nvm))
end
State:trigger_state(pos, nvm)
return true
end