]> git.lizzy.rs Git - dragonfireclient.git/blob - builtin/init.lua
Update buildbot scripts and add 64-bit buildbot
[dragonfireclient.git] / builtin / init.lua
1 --
2 -- This file contains built-in stuff in Minetest implemented in Lua.
3 --
4 -- It is always loaded and executed after registration of the C API,
5 -- before loading and running any mods.
6 --
7
8 -- Initialize some very basic things
9 print = core.debug
10 math.randomseed(os.time())
11 os.setlocale("C", "numeric")
12 minetest = core
13
14 -- Load other files
15 local scriptdir = core.get_builtin_path()..DIR_DELIM
16 local gamepath = scriptdir.."game"..DIR_DELIM
17 local commonpath = scriptdir.."common"..DIR_DELIM
18 local asyncpath = scriptdir.."async"..DIR_DELIM
19
20 dofile(commonpath.."serialize.lua")
21 dofile(commonpath.."misc_helpers.lua")
22
23 if INIT == "game" then
24         dofile(gamepath.."init.lua")
25 elseif INIT == "mainmenu" then
26         local mainmenuscript = core.setting_get("main_menu_script")
27         if mainmenuscript ~= nil and mainmenuscript ~= "" then
28                 dofile(mainmenuscript)
29         else
30                 dofile(core.get_mainmenu_path()..DIR_DELIM.."init.lua")
31         end
32 elseif INIT == "async" then
33         dofile(asyncpath.."init.lua")
34 else
35         error(("Unrecognized builtin initialization type %s!"):format(tostring(INIT)))
36 end
37