Initial revision of animqueue
This commit is contained in:
@@ -2,6 +2,17 @@
|
||||
#include "globaldb.hpp"
|
||||
#include "table.hpp"
|
||||
|
||||
LuaDefine(globaldb_enable, "c") {
|
||||
LuaVar globaldb;
|
||||
LuaStack LS(L, globaldb);
|
||||
LS.getfield(globaldb, LuaRegistry, "globaldb");
|
||||
if (!LS.istable(globaldb)) {
|
||||
LS.newtable(globaldb);
|
||||
LS.setfield(LuaRegistry, "globaldb", globaldb);
|
||||
}
|
||||
return LS.result();
|
||||
}
|
||||
|
||||
// Get a table from the global database.
|
||||
//
|
||||
// GLOBALNAME
|
||||
@@ -15,15 +26,14 @@ LuaDefine(globaldb_global, "f") {
|
||||
LuaVar globaldb;
|
||||
LuaStack LS(L, globalname, globaltab, globaldb);
|
||||
|
||||
LS.checkstring(globalname);
|
||||
|
||||
// Get a pointer to the globaldb.
|
||||
// Get a pointer to the globaldb.
|
||||
LS.getfield(globaldb, LuaRegistry, "globaldb");
|
||||
if (!LS.istable(globaldb)) {
|
||||
LS.newtable(globaldb);
|
||||
LS.setfield(LuaRegistry, "globaldb", globaldb);
|
||||
luaL_error(L, "globaldb is not enabled");
|
||||
}
|
||||
|
||||
LS.checkstring(globalname);
|
||||
|
||||
// Get the globaltab from the globaldb, sanity check it.
|
||||
LS.rawget(globaltab, globaldb, globalname);
|
||||
if (LS.istable(globaltab)) {
|
||||
|
||||
Reference in New Issue
Block a user