From 148bd140c23906c5fe6f8666392ab7410d64b206 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Sun, 13 Jan 2019 20:16:53 +0100 Subject: [PATCH] hook_cmd_running around the loop rather than inside --- src/lua_hooklib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 1a1d4ed6..5a95877e 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -889,10 +889,10 @@ boolean LUAh_PlayerCmd(player_t *player, ticcmd_t *cmd) lua_settop(gL, 0); + hook_cmd_running = true; for (hookp = roothook; hookp; hookp = hookp->next) if (hookp->type == hook_PlayerCmd) { - hook_cmd_running = true; if (lua_gettop(gL) == 0) { LUA_PushUserdata(gL, player, META_PLAYER); @@ -912,9 +912,9 @@ boolean LUAh_PlayerCmd(player_t *player, ticcmd_t *cmd) if (lua_toboolean(gL, -1)) hooked = true; lua_pop(gL, 1); - hook_cmd_running = false; } + hook_cmd_running = false; lua_settop(gL, 0); return hooked; }