Added the "lua_lumploading" variable for restricting certain Lua functions to lump load time only

This commit is contained in:
Monster Iestyn 2017-04-25 21:45:53 +01:00
parent bbeb69c477
commit 1462c638cb
6 changed files with 27 additions and 7 deletions

View file

@ -108,8 +108,8 @@ static int lib_addHook(lua_State *L)
luaL_checktype(L, 1, LUA_TFUNCTION);
if (hud_running)
return luaL_error(L, "HUD rendering code should not call this function!");
if (!lua_lumploading)
return luaL_error(L, "This function cannot be called from within a hook or coroutine!");
switch(hook.type)
{