add app.reset_content 'non_reset_packs' optional argument
This commit is contained in:
@@ -43,7 +43,16 @@ static int l_reset_content(lua::State* L) {
|
||||
if (level != nullptr) {
|
||||
throw std::runtime_error("world must be closed before");
|
||||
}
|
||||
content_control->resetContent();
|
||||
std::vector<std::string> nonResetPacks;
|
||||
if (lua::istable(L, 1)) {
|
||||
int len = lua::objlen(L, 1);
|
||||
for (int i = 0; i < len; i++) {
|
||||
lua::rawgeti(L, i + 1, 1);
|
||||
nonResetPacks.emplace_back(lua::require_lstring(L, -1));
|
||||
lua::pop(L);
|
||||
}
|
||||
}
|
||||
content_control->resetContent(std::move(nonResetPacks));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user