Makeclass cleaned up
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
LuaDefine(globaldb_enable, "c") {
|
||||
LuaVar globaldb;
|
||||
LuaStack LS(L, globaldb);
|
||||
LS.getfield(globaldb, LuaRegistry, "globaldb");
|
||||
LS.rawget(globaldb, LuaRegistry, "globaldb");
|
||||
if (!LS.istable(globaldb)) {
|
||||
LS.newtable(globaldb);
|
||||
LS.setfield(LuaRegistry, "globaldb", globaldb);
|
||||
LS.rawset(LuaRegistry, "globaldb", globaldb);
|
||||
}
|
||||
return LS.result();
|
||||
}
|
||||
@@ -26,7 +26,7 @@ LuaDefine(globaldb_global, "f") {
|
||||
LuaStack LS(L, globalname, globaltab, globaldb);
|
||||
|
||||
// Get a pointer to the globaldb.
|
||||
LS.getfield(globaldb, LuaRegistry, "globaldb");
|
||||
LS.rawget(globaldb, LuaRegistry, "globaldb");
|
||||
if (!LS.istable(globaldb)) {
|
||||
luaL_error(L, "globaldb is not enabled");
|
||||
}
|
||||
@@ -44,6 +44,6 @@ LuaDefine(globaldb_global, "f") {
|
||||
// Create a new globaltab and store it in the globaldb.
|
||||
LS.newtable(globaltab);
|
||||
LS.rawset(globaldb, globalname, globaltab);
|
||||
LS.setfield(globaltab, "__global", globalname);
|
||||
LS.rawset(globaltab, "__global", globalname);
|
||||
return LS.result();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user