mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-28 21:31:04 +00:00
Remove boolean remnants
This commit is contained in:
parent
b5988e082c
commit
b1ce5896aa
1 changed files with 3 additions and 17 deletions
|
@ -802,7 +802,6 @@ void LUAh_NetArchiveHook(lua_CFunction archFunc)
|
||||||
void LUAh_PlayerQuit(player_t *plr, int reason)
|
void LUAh_PlayerQuit(player_t *plr, int reason)
|
||||||
{
|
{
|
||||||
hook_p hookp;
|
hook_p hookp;
|
||||||
boolean hooked = false;
|
|
||||||
if (!gL || !(hooksAvailable[hook_PlayerQuit/8] & (1<<(hook_PlayerQuit%8))))
|
if (!gL || !(hooksAvailable[hook_PlayerQuit/8] & (1<<(hook_PlayerQuit%8))))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -811,29 +810,16 @@ void LUAh_PlayerQuit(player_t *plr, int reason)
|
||||||
for (hookp = roothook; hookp; hookp = hookp->next)
|
for (hookp = roothook; hookp; hookp = hookp->next)
|
||||||
if (hookp->type == hook_PlayerQuit)
|
if (hookp->type == hook_PlayerQuit)
|
||||||
{
|
{
|
||||||
if (lua_gettop(gL) == 0)
|
LUA_PushUserdata(gL, plr, META_PLAYER); // Player that quit
|
||||||
{
|
lua_pushinteger(gL, reason); // Reason for quitting
|
||||||
LUA_PushUserdata(gL, plr, META_PLAYER); // Player that quit
|
|
||||||
lua_pushinteger(gL, reason); // Reason for quitting
|
|
||||||
}
|
|
||||||
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
||||||
lua_gettable(gL, LUA_REGISTRYINDEX);
|
lua_gettable(gL, LUA_REGISTRYINDEX);
|
||||||
lua_pushvalue(gL, -3);
|
lua_pushvalue(gL, -3);
|
||||||
lua_pushvalue(gL, -3);
|
lua_pushvalue(gL, -3);
|
||||||
if (lua_pcall(gL, 2, 1, 0)) {
|
LUA_Call(gL, 2);
|
||||||
if (!hookp->error || cv_debug & DBG_LUA)
|
|
||||||
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
|
||||||
lua_pop(gL, 1);
|
|
||||||
hookp->error = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (lua_toboolean(gL, -1))
|
|
||||||
hooked = true;
|
|
||||||
lua_pop(gL, 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lua_settop(gL, 0);
|
lua_settop(gL, 0);
|
||||||
return hooked;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue