mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +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
|
#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)
|
boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname)
|
||||||
{
|
{
|
||||||
hook_p hookp;
|
hook_p hookp;
|
||||||
|
@ -1728,3 +1705,26 @@ boolean LUAh_ShouldJingleContinue(player_t *player, const char *musname)
|
||||||
|
|
||||||
return keepplaying;
|
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