Another refactor to remove references to the world model from LuaStack

This commit is contained in:
2026-02-21 22:00:23 -05:00
parent e9d185acb0
commit afa8c698be
3 changed files with 5 additions and 42 deletions

View File

@@ -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);
}
}
}