From 4268a05d5ab7c33da4aaab91108addc6cae6caf2 Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Mon, 16 Aug 2021 17:23:25 +0200 Subject: [PATCH] Fix mod.get_resource being unavailable --- init.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 2490e78..e65efdf 100644 --- a/init.lua +++ b/init.lua @@ -129,9 +129,11 @@ modlib = setmetatable({ end }) +_ml = modlib if minetest then modlib.mod = dofile(get_resource(modlib.modname, "mod.lua")) + modlib.mod.get_resource = get_resource -- HACK force load minetest/gametime.lua to ensure that the globalstep is registered earlier than globalsteps of mods depending on modlib _ = modlib.minetest dofile(get_resource(modlib.modname, "minetest", "gametime.lua")) @@ -142,7 +144,6 @@ if minetest then modlib.persistence = assert(loadfile(get_resource"persistence.lua"))(ie.require) end modlib.conf.build_setting_tree() - modlib.mod.get_resource = get_resource end _ml = modlib