diff --git a/src/engine/ServerMainloop.cpp b/src/engine/ServerMainloop.cpp index eb570e7b..b97919be 100644 --- a/src/engine/ServerMainloop.cpp +++ b/src/engine/ServerMainloop.cpp @@ -70,7 +70,7 @@ void ServerMainloop::run() { begin = system_clock::now(); } } - logger.info() << "test finished"; + logger.info() << "script finished"; } void ServerMainloop::setLevel(std::unique_ptr level) { diff --git a/src/logic/scripting/lua/libs/libcore.cpp b/src/logic/scripting/lua/libs/libcore.cpp index 7946d301..3daebca5 100644 --- a/src/logic/scripting/lua/libs/libcore.cpp +++ b/src/logic/scripting/lua/libs/libcore.cpp @@ -55,6 +55,9 @@ static int l_new_world(lua::State* L) { auto name = lua::require_string(L, 1); auto seed = lua::require_string(L, 2); auto generator = lua::require_string(L, 3); + if (level != nullptr) { + throw std::runtime_error("world must be closed before"); + } auto controller = engine->getController(); controller->createWorld(name, seed, generator); return 0; @@ -64,7 +67,9 @@ static int l_new_world(lua::State* L) { /// @param name Name world static int l_open_world(lua::State* L) { auto name = lua::require_string(L, 1); - + if (level != nullptr) { + throw std::runtime_error("world must be closed before"); + } auto controller = engine->getController(); controller->openWorld(name, false); return 0;