A few assorted cleanups.

This commit is contained in:
2021-10-13 19:41:59 -04:00
parent bf3dd49cc8
commit 5b3f3b7ff0
7 changed files with 35 additions and 9 deletions

View File

@@ -40,7 +40,11 @@ LuaDefine(tangible_setclass, "c") {
LuaStack LS(L, tanobj, classname, classtab, mt);
World *w = World::fetch_global_pointer(L);
w->tangible_get(LS, tanobj);
LS.getclass(classtab, classname);
if (LS.classname(classname) != "") {
LS.set(classtab, classname);
} else {
LS.getclass(classtab, classname);
}
LS.getmetatable(mt, tanobj);
LS.rawset(mt, "__index", classtab);
return LS.result();