From 9e1a2a52017f6993b1a717afa6b5b3cbf6287568 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 27 Jan 2023 19:06:24 +0000 Subject: [PATCH] lib_freeslot: Init dehacked state so SOC initialised later won't nuke freeslots generated here --- src/deh_lua.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/deh_lua.c b/src/deh_lua.c index f131617c6..b3ad0f1c5 100644 --- a/src/deh_lua.c +++ b/src/deh_lua.c @@ -41,6 +41,11 @@ static inline int lib_freeslot(lua_State *L) if (!lua_lumploading) 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) { s = Z_StrDup(luaL_checkstring(L,1));