update non-reset-packs semantics
This commit is contained in:
@@ -336,6 +336,22 @@ int lua::create_environment(State* L, int parent) {
|
||||
return id;
|
||||
}
|
||||
|
||||
int lua::restore_pack_environment(lua::State* L, const std::string& packid) {
|
||||
if(!lua::getglobal(L, "__vc__pack_envs")) {
|
||||
return -1;
|
||||
}
|
||||
int id = nextEnvironment++;
|
||||
|
||||
if (lua::getfield(L, packid)) {
|
||||
// envname = env
|
||||
setglobal(L, env_name(id));
|
||||
lua::pop(L);
|
||||
return id;
|
||||
}
|
||||
lua::pop(L);
|
||||
return -1;
|
||||
}
|
||||
|
||||
void lua::remove_environment(State* L, int id) {
|
||||
if (id == 0) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user