mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-29 05:41:02 +00:00
Merge remote-tracking branch 'remotes/pub/next' into v1
This commit is contained in:
commit
50b00d37e0
3 changed files with 31 additions and 0 deletions
|
@ -51,6 +51,7 @@ enum hook {
|
||||||
hook_PlayerExplode, //SRB2KART
|
hook_PlayerExplode, //SRB2KART
|
||||||
hook_PlayerSquish, //SRB2KART
|
hook_PlayerSquish, //SRB2KART
|
||||||
hook_PlayerCmd, //SRB2KART
|
hook_PlayerCmd, //SRB2KART
|
||||||
|
hook_IntermissionThinker, //SRB2KART
|
||||||
|
|
||||||
hook_MAX // last hook
|
hook_MAX // last hook
|
||||||
};
|
};
|
||||||
|
@ -99,4 +100,6 @@ boolean LUAh_PlayerSquish(player_t *player, mobj_t *inflictor, mobj_t *source);
|
||||||
|
|
||||||
boolean LUAh_PlayerCmd(player_t *player, ticcmd_t *cmd); // Allows to write to player cmd before the game does anything with them.
|
boolean LUAh_PlayerCmd(player_t *player, ticcmd_t *cmd); // Allows to write to player cmd before the game does anything with them.
|
||||||
|
|
||||||
|
void LUAh_IntermissionThinker(void); // Hook for Y_Ticker
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -62,6 +62,7 @@ const char *const hookNames[hook_MAX+1] = {
|
||||||
"PlayerExplode",
|
"PlayerExplode",
|
||||||
"PlayerSquish",
|
"PlayerSquish",
|
||||||
"PlayerCmd",
|
"PlayerCmd",
|
||||||
|
"IntermissionThinker",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -420,6 +421,28 @@ void LUAh_ThinkFrame(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hook for Y_Ticker
|
||||||
|
void LUAh_IntermissionThinker(void)
|
||||||
|
{
|
||||||
|
hook_p hookp;
|
||||||
|
if (!gL || !(hooksAvailable[hook_IntermissionThinker/8] & (1<<(hook_IntermissionThinker%8))))
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (hookp = roothook; hookp; hookp = hookp->next)
|
||||||
|
if (hookp->type == hook_IntermissionThinker)
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Hook for mobj collisions
|
// Hook for mobj collisions
|
||||||
UINT8 LUAh_MobjCollideHook(mobj_t *thing1, mobj_t *thing2, enum hook which)
|
UINT8 LUAh_MobjCollideHook(mobj_t *thing1, mobj_t *thing2, enum hook which)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#include "g_input.h" // PLAYER1INPUTDOWN
|
#include "g_input.h" // PLAYER1INPUTDOWN
|
||||||
#include "k_kart.h" // colortranslations
|
#include "k_kart.h" // colortranslations
|
||||||
#include "console.h" // cons_menuhighlight
|
#include "console.h" // cons_menuhighlight
|
||||||
|
#include "lua_hook.h" // IntermissionThinker hook
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
#include "hardware/hw_main.h"
|
#include "hardware/hw_main.h"
|
||||||
|
@ -574,6 +575,10 @@ void Y_Ticker(void)
|
||||||
if (paused || P_AutoPause())
|
if (paused || P_AutoPause())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef HAVE_BLUA
|
||||||
|
LUAh_IntermissionThinker();
|
||||||
|
#endif
|
||||||
|
|
||||||
intertic++;
|
intertic++;
|
||||||
|
|
||||||
// Team scramble code for team match and CTF.
|
// Team scramble code for team match and CTF.
|
||||||
|
|
Loading…
Reference in a new issue