Another refactor to remove references to the world model from LuaStack
This commit is contained in:
@@ -131,8 +131,6 @@ World::World(WorldType wt) {
|
||||
LS.getglobaltable(globtab);
|
||||
LS.settabletype(globtab, LUA_TT_GLOBALENV);
|
||||
|
||||
// Store whether the world is authoritative in the registry.
|
||||
LS.set_authoritative(wt == WORLD_TYPE_MASTER);
|
||||
|
||||
// Create the globaldb in the registry.
|
||||
LS.rawset(LuaRegistry, "globaldb", LuaNewTable);
|
||||
@@ -1002,14 +1000,12 @@ void World::guard_blockable(lua_State *L, const char *fn) {
|
||||
}
|
||||
|
||||
void World::guard_nopredict(lua_State *L, const char *fn) {
|
||||
// Caution: this code must be equivalent to the
|
||||
// code in LuaCoreStack::guard_nopredict.
|
||||
if (lthread_thread_id_ == 0) {
|
||||
return;
|
||||
}
|
||||
if (!is_authoritative()) {
|
||||
lua_yield(L, 0);
|
||||
luaL_error(L, "unexplained nopredict failure in %s", fn);
|
||||
if (lthread_thread_id_ == 0) return;
|
||||
if (lua_isyieldable(L)) {
|
||||
lua_yield(L, 0);
|
||||
luaL_error(L, "unexplained nopredict failure in %s", fn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user