mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-02-28 22:51:29 +00:00
hook_cmd_running around the loop rather than inside
This commit is contained in:
parent
c2aa6d4de6
commit
148bd140c2
1 changed files with 2 additions and 2 deletions
|
@ -889,10 +889,10 @@ boolean LUAh_PlayerCmd(player_t *player, ticcmd_t *cmd)
|
||||||
|
|
||||||
lua_settop(gL, 0);
|
lua_settop(gL, 0);
|
||||||
|
|
||||||
|
hook_cmd_running = true;
|
||||||
for (hookp = roothook; hookp; hookp = hookp->next)
|
for (hookp = roothook; hookp; hookp = hookp->next)
|
||||||
if (hookp->type == hook_PlayerCmd)
|
if (hookp->type == hook_PlayerCmd)
|
||||||
{
|
{
|
||||||
hook_cmd_running = true;
|
|
||||||
if (lua_gettop(gL) == 0)
|
if (lua_gettop(gL) == 0)
|
||||||
{
|
{
|
||||||
LUA_PushUserdata(gL, player, META_PLAYER);
|
LUA_PushUserdata(gL, player, META_PLAYER);
|
||||||
|
@ -912,9 +912,9 @@ boolean LUAh_PlayerCmd(player_t *player, ticcmd_t *cmd)
|
||||||
if (lua_toboolean(gL, -1))
|
if (lua_toboolean(gL, -1))
|
||||||
hooked = true;
|
hooked = true;
|
||||||
lua_pop(gL, 1);
|
lua_pop(gL, 1);
|
||||||
hook_cmd_running = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hook_cmd_running = false;
|
||||||
lua_settop(gL, 0);
|
lua_settop(gL, 0);
|
||||||
return hooked;
|
return hooked;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue