Remove action subtable, fix bug in makeclass

This commit is contained in:
2021-12-28 13:56:16 -05:00
parent 154ee737c6
commit 2e543984e6
7 changed files with 13 additions and 56 deletions

View File

@@ -53,22 +53,6 @@ LuaDefine(classname, "classtable", "get the class name from a class table") {
return LS.result();
}
LuaDefine(maketangible, "classname", "create a class if it doesn't already exist, and add tangible features") {
LuaArg classname;
LuaRet classtab;
LuaVar subtab;
LuaStack LS(L, classname, classtab, subtab);
if (!LS.isstring(classname)) {
luaL_error(L, "class name must be a string");
}
if (!LS.validclassname(classname)) {
luaL_error(L, "invalid class name: %s", LS.ckstring(classname).c_str());
};
LS.makeclass(classtab, classname);
LS.makesubtable(subtab, classtab, "action");
return LS.result();
}
static void get_reg_name(const LuaFunctionReg *reg, std::string &classname, std::string &funcname) {
std::string name = reg->get_name();
size_t upos = name.find('_');