public void UnFakeG() { if (!this.CanFakeEnvironment) { return; } BBLua.lua_getinfo(ls.L, "f", this.funcInfo); // 'f': pushes func onto stack foreach (FakeVar fv in this.fakedUpvalues) { GetVarAndCleanG(fv.VarName); string vn = BBLua.lua_setupvalue(ls.L, -2, fv.Number); } BBLua.lua_settop(ls.L, -2); //remove func foreach (FakeVar fv in this.fakedLocals) { GetVarAndCleanG(fv.VarName); string vn = BBLua.lua_setlocal(ls.L, this.funcInfo, fv.Number); } }