mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Moved LUAh_GameQuit(void) function to the end of the lua_hooklib.c
This commit is contained in:
parent
21353f1209
commit
decce7905b
1 changed files with 23 additions and 23 deletions
|
@ -1663,29 +1663,6 @@ boolean LUAh_SeenPlayer(player_t *player, player_t *seenfriend)
|
|||
}
|
||||
#endif // SEENAMES
|
||||
|
||||
// Hook for game quitting
|
||||
void LUAh_GameQuit(void)
|
||||
{
|
||||
hook_p hookp;
|
||||
if (!gL || !(hooksAvailable[hook_GameQuit/8] & (1<<(hook_GameQuit%8))))
|
||||
return;
|
||||
|
||||
for (hookp = roothook; hookp; hookp = hookp->next)
|
||||
{
|
||||
if (hookp->type != hook_GameQuit)
|
||||
continue;
|
||||
|
||||
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
||||
lua_gettable(gL, LUA_REGISTRYINDEX);
|
||||
if (lua_pcall(gL, 0, 0, 0)) {
|
||||
if (!hookp->error || cv_debug & DBG_LUA)
|
||||
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
||||
lua_pop(gL, 1);
|
||||
hookp->error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname)
|
||||
{
|
||||
hook_p hookp;
|
||||
|
@ -1727,4 +1704,27 @@ boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname)
|
|||
hud_running = false;
|
||||
|
||||
return keepplaying;
|
||||
}
|
||||
|
||||
// Hook for game quitting
|
||||
void LUAh_GameQuit(void)
|
||||
{
|
||||
hook_p hookp;
|
||||
if (!gL || !(hooksAvailable[hook_GameQuit/8] & (1<<(hook_GameQuit%8))))
|
||||
return;
|
||||
|
||||
for (hookp = roothook; hookp; hookp = hookp->next)
|
||||
{
|
||||
if (hookp->type != hook_GameQuit)
|
||||
continue;
|
||||
|
||||
lua_pushfstring(gL, FMT_HOOKID, hookp->id);
|
||||
lua_gettable(gL, LUA_REGISTRYINDEX);
|
||||
if (lua_pcall(gL, 0, 0, 0)) {
|
||||
if (!hookp->error || cv_debug & DBG_LUA)
|
||||
CONS_Alert(CONS_WARNING,"%s\n",lua_tostring(gL, -1));
|
||||
lua_pop(gL, 1);
|
||||
hookp->error = true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue