From dc37f37bb903191dd3b8815dda2d41611b272cbe Mon Sep 17 00:00:00 2001 From: gpcf Date: Mon, 15 May 2023 09:18:56 +0200 Subject: Add register_function command so mods can register their own functons --- advtrains_luaautomation/environment.lua | 7 +++---- advtrains_luaautomation/mod.conf | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/advtrains_luaautomation/environment.lua b/advtrains_luaautomation/environment.lua index 3499903..9bd1cf6 100644 --- a/advtrains_luaautomation/environment.lua +++ b/advtrains_luaautomation/environment.lua @@ -259,10 +259,9 @@ if advtrains.lines then } end -if departureboards then - static_env.departureboard_set = function(pos, tb) - departureboards.contents[minetest.hash_node_position(pos)] = tb - end + +atlatc.register_function = function (name, f) + static_env[name] = f end for _, name in pairs(safe_globals) do diff --git a/advtrains_luaautomation/mod.conf b/advtrains_luaautomation/mod.conf index f135d8f..a737603 100644 --- a/advtrains_luaautomation/mod.conf +++ b/advtrains_luaautomation/mod.conf @@ -4,4 +4,4 @@ description=Lua control interface to Advanced Trains author=orwell96 depends=advtrains -optional_depends=advtrains_interlocking,advtrains_line_automation,mesecons_switch,departureboards +optional_depends=advtrains_interlocking,advtrains_line_automation,mesecons_switch -- cgit v1.2.3