Added new tangible ops, including tangible.delete

This commit is contained in:
2021-03-19 13:41:41 -04:00
parent 05052f846e
commit e06bae63f7
5 changed files with 138 additions and 41 deletions

View File

@@ -125,16 +125,7 @@ LuaDefine(table_count, "c") {
LuaDefine(table_clear, "c") {
LuaArg tab;
LuaStack LS(L, tab);
LS.checktable(tab);
lua_pushnil(L);
while (lua_next(L, tab.index()) != 0) {
lua_pop(L, 1); // Pop the old value.
lua_pushvalue(L, -1); // Clone the key
lua_pushnil(L); // Push the new value.
lua_settable(L, tab.index());
}
LS.cleartable(tab);
return LS.result();
}