Improve implementation of LS.getclass and LS.classname, make it more consistent.

This commit is contained in:
2024-09-18 16:09:05 -04:00
parent 2913f2bac2
commit 14b5c4ed8f
9 changed files with 96 additions and 104 deletions

View File

@@ -21,7 +21,7 @@ LuaDefine(makeclass, "classname", "create a class if it doesn't already exist")
LuaArg classname;
LuaRet classtab;
LuaDefStack LS(L, classname, classtab);
if (!LS.validclassname(classname)) {
if (!sv::is_lua_classname(LS.ckstring(classname))) {
luaL_error(L, "invalid class name: %s", LS.ckstring(classname).c_str());
};
LS.makeclass(classtab, classname);