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

@@ -94,10 +94,6 @@ lua_State *LuaCoreStack::newstate (lua_Alloc allocf) {
lua_pushstring(L, "tangibles");
lua_newtable(L);
lua_rawset(L, LUA_REGISTRYINDEX);
lua_pushstring(L, "is_authoritative");
lua_pushboolean(L, 1);
lua_rawset(L, LUA_REGISTRYINDEX);
return L;
}
@@ -687,24 +683,6 @@ void LuaCoreStack::setvisited(LuaSlot tab, bool visited) const {
lua_modflagbits(L_, tab.index(), 0x0010, visited ? 0x0010 : 0);
}
void LuaCoreStack::set_authoritative(bool auth) const {
lua_pushstring(L_, "is_authoritative");
lua_pushboolean(L_, auth ? 1 : 0);
lua_rawset(L_, LUA_REGISTRYINDEX);
}
void LuaCoreStack::guard_nopredict(const char *fn) {
if (lua_isyieldable(L_)) {
lua_pushstring(L_, "is_authoritative");
lua_rawget(L_, LUA_REGISTRYINDEX);
bool auth = lua_toboolean(L_, -1);
lua_pop(L_, 1);
if (!auth) {
lua_yield(L_, 0);
luaL_error(L_, "unexplained nopredict failure in %s", fn);
}
}
}
static int tailcall_continuation(lua_State *L)
{