Remove boolean remnants

This commit is contained in:
Prisima the Fox 2016-11-08 10:30:01 -05:00
parent b5988e082c
commit b1ce5896aa

View file

@ -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