aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_mainmenu.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp
index e6fcdcf83..36b97b2d1 100644
--- a/src/script/lua_api/l_mainmenu.cpp
+++ b/src/script/lua_api/l_mainmenu.cpp
@@ -644,15 +644,12 @@ int ModApiMainMenu::l_create_world(lua_State *L)
(gameidx < (int) games.size())) {
// Create world if it doesn't exist
- if(!initializeWorld(path, games[gameidx].id)){
+ if (!loadGameConfAndInitWorld(path, games[gameidx])) {
lua_pushstring(L, "Failed to initialize world");
-
- }
- else {
- lua_pushnil(L);
+ } else {
+ lua_pushnil(L);
}
- }
- else {
+ } else {
lua_pushstring(L, "Invalid game index");
}
return 1;