diff --git a/init.lua b/init.lua index ef92d6f..7a657e6 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,10 @@ yl_speak_up = {} +-- some mods (i.e. yl_speak_up_addons) need to be called again when +-- this mod is reloaded via chat command "/npc_talk_reload"; +-- this is a list of such functions +yl_speak_up.inform_when_reloaded = {} + local modpath = minetest.get_modpath("yl_speak_up")..DIR_DELIM yl_speak_up.worldpath = minetest.get_worldpath()..DIR_DELIM yl_speak_up.modpath = modpath @@ -122,6 +127,11 @@ yl_speak_up.reload = function(modpath, log_entry) if(log_entry) then minetest.log("action","[MOD] yl_speak_up "..tostring(log_entry)) end + + -- reload all mods that may have to add something as well + for i, f in ipairs(yl_speak_up.inform_when_reloaded) do + f() + end end -- register all the necessary things; this ought to be done only once