diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-11-25 21:32:12 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-11-29 19:13:52 +0200 |
commit | 61ffe1eac4565bbb74b79677a618e7f4dd894d3c (patch) | |
tree | abd409f18a09d63e457e3953a46965314eed860d /src | |
parent | 9e7ad1e2aa832ff93a623e7a1531cee1f1e79ef7 (diff) | |
download | minetest-61ffe1eac4565bbb74b79677a618e7f4dd894d3c.tar.gz minetest-61ffe1eac4565bbb74b79677a618e7f4dd894d3c.tar.bz2 minetest-61ffe1eac4565bbb74b79677a618e7f4dd894d3c.zip |
builtin.lua
Diffstat (limited to 'src')
-rw-r--r-- | src/server.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/server.cpp b/src/server.cpp index fea103e1c..6d34a0fac 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1024,6 +1024,8 @@ Server::Server( // Initialize default node definitions content_mapnode_init(m_nodedef); + // Path to builtin.lua + std::string builtinpath = porting::path_data + DIR_DELIM + "builtin.lua"; // Add default global mod path m_modspaths.push_back(porting::path_data + DIR_DELIM + "mods"); @@ -1034,7 +1036,16 @@ Server::Server( assert(m_lua); // Export API scriptapi_export(m_lua, this); - // Load and run scripts + // Load and run builtin.lua + infostream<<"Server: Loading builtin Lua stuff from \""<<builtinpath + <<"\""<<std::endl; + bool success = script_load(m_lua, builtinpath.c_str()); + if(!success){ + errorstream<<"Server: Failed to load and run " + <<builtinpath<<std::endl; + assert(0); + } + // Load and run "mod" scripts core::list<ModSpec> mods = getMods(m_modspaths); for(core::list<ModSpec>::Iterator i = mods.begin(); i != mods.end(); i++){ |