From 1b8978326beeb6cdb57ead65713c66cb4bf0487e Mon Sep 17 00:00:00 2001 From: Joachim Stolberg Date: Fri, 30 Apr 2021 19:00:59 +0200 Subject: [PATCH] minor improvements --- basic_machines/forceload.lua | 2 +- basis/node_states.lua | 4 ++++ lua_controller/controller.lua | 1 + solar/inverter.lua | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/basic_machines/forceload.lua b/basic_machines/forceload.lua index e36771a..fdbde0c 100644 --- a/basic_machines/forceload.lua +++ b/basic_machines/forceload.lua @@ -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) diff --git a/basis/node_states.lua b/basis/node_states.lua index 30b87fa..23a1909 100644 --- a/basis/node_states.lua +++ b/basis/node_states.lua @@ -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) diff --git a/lua_controller/controller.lua b/lua_controller/controller.lua index 5e64e56..7855999 100644 --- a/lua_controller/controller.lua +++ b/lua_controller/controller.lua @@ -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".. diff --git a/solar/inverter.lua b/solar/inverter.lua index 6b32579..9930e31 100644 --- a/solar/inverter.lua +++ b/solar/inverter.lua @@ -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