mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
add test.quit, test.reopen_world
This commit is contained in:
parent
fa1646a9bd
commit
5e55e20ec4
6 changed files with 55 additions and 2 deletions
|
|
@ -56,6 +56,9 @@ static int l_open_world(lua::State* L) {
|
|||
/// @brief Reopen world
|
||||
static int l_reopen_world(lua::State*) {
|
||||
auto controller = engine->getController();
|
||||
if (level == nullptr) {
|
||||
throw std::runtime_error("no world open");
|
||||
}
|
||||
controller->reopenWorld(level->getWorld());
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -229,7 +232,7 @@ static int l_open_folder(lua::State* L) {
|
|||
|
||||
/// @brief Quit the game
|
||||
static int l_quit(lua::State*) {
|
||||
Window::setShouldClose(true);
|
||||
engine->quit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue