Skip to content

Commit

Permalink
add app.reset_content()
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailRis committed Jan 6, 2025
1 parent 550f3c4 commit e2bc168
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions res/scripts/stdlib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ local function complete_app_lib(app)
app.get_version = core.get_version
app.get_setting_info = core.get_setting_info
app.load_content = core.load_content
app.reset_content = core.reset_content

function app.config_packs(packs_list)
-- Check if packs are valid and add dependencies to the configuration
Expand Down
6 changes: 6 additions & 0 deletions src/logic/scripting/lua/libs/libcore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ static int l_load_content(lua::State* L) {
return 0;
}

static int l_reset_content(lua::State* L) {
engine->resetContent();
return 0;
}

/// @brief Creating new world
/// @param name Name world
/// @param seed Seed world
Expand Down Expand Up @@ -249,6 +254,7 @@ const luaL_Reg corelib[] = {
{"blank", lua::wrap<l_blank>},
{"get_version", lua::wrap<l_get_version>},
{"load_content", lua::wrap<l_load_content>},
{"reset_content", lua::wrap<l_reset_content>},
{"new_world", lua::wrap<l_new_world>},
{"open_world", lua::wrap<l_open_world>},
{"reopen_world", lua::wrap<l_reopen_world>},
Expand Down

0 comments on commit e2bc168

Please sign in to comment.