Add a .mailmap file
[oweals/minetest.git] / builtin / init.lua
index 9969111b8aa83f124032555117dcbeec469b23c5..6fc1bf6d5732ecec60819b0a87b6f01122ba5a79 100644 (file)
@@ -5,13 +5,11 @@
 -- before loading and running any mods.
 --
 
-local core = minetest or engine
-minetest = core
-
 -- Initialize some very basic things
 print = core.debug
 math.randomseed(os.time())
 os.setlocale("C", "numeric")
+minetest = core
 
 -- Load other files
 local scriptdir = core.get_builtin_path()..DIR_DELIM
@@ -25,7 +23,12 @@ dofile(commonpath.."misc_helpers.lua")
 if INIT == "game" then
        dofile(gamepath.."init.lua")
 elseif INIT == "mainmenu" then
-       dofile(core.get_mainmenu_path()..DIR_DELIM.."init.lua")
+       local mainmenuscript = core.setting_get("main_menu_script")
+       if mainmenuscript ~= nil and mainmenuscript ~= "" then
+               dofile(mainmenuscript)
+       else
+               dofile(core.get_mainmenu_path()..DIR_DELIM.."init.lua")
+       end
 elseif INIT == "async" then
        dofile(asyncpath.."init.lua")
 else