Some more error checking for class names and tangible IDs
This commit is contained in:
@@ -227,13 +227,12 @@ LuaDefine(tangible_getclass, "tan",
|
||||
"|The return value is a string, the class name, not"
|
||||
"|the class table.") {
|
||||
LuaArg tanobj;
|
||||
LuaVar mt, classtab;
|
||||
LuaVar classtab;
|
||||
LuaRet classname;
|
||||
LuaDefStack LS(L, tanobj, mt, classtab, classname);
|
||||
LuaDefStack LS(L, tanobj, classtab, classname);
|
||||
World *w = World::fetch_global_pointer(L);
|
||||
w->tangible_get(LS, tanobj, false);
|
||||
LS.getmetatable(mt, tanobj);
|
||||
LS.rawget(classtab, mt, "__index");
|
||||
LS.tangetclass(classtab, tanobj);
|
||||
eng::string name = LS.classname(classtab);
|
||||
if (name == "") {
|
||||
LS.set(classname, LuaNil);
|
||||
|
||||
Reference in New Issue
Block a user