lib_freeslot: Init dehacked state so SOC initialised later won't nuke freeslots generated here

This commit is contained in:
toaster 2023-01-27 19:06:24 +00:00
parent ab77b88a24
commit 9e1a2a5201

View file

@ -41,6 +41,11 @@ static inline int lib_freeslot(lua_State *L)
if (!lua_lumploading) if (!lua_lumploading)
return luaL_error(L, "This function cannot be called from within a hook or coroutine!"); return luaL_error(L, "This function cannot be called from within a hook or coroutine!");
if (!deh_loaded)
initfreeslots();
deh_loaded = true;
while (n-- > 0) while (n-- > 0)
{ {
s = Z_StrDup(luaL_checkstring(L,1)); s = Z_StrDup(luaL_checkstring(L,1));