Expose K_PlayerJustBumped to Lua

This commit is contained in:
JugadorXEI 2025-08-22 08:50:03 +02:00
parent 607e6cd39d
commit 6fb9a98896
3 changed files with 14 additions and 1 deletions

View file

@ -815,7 +815,7 @@ static void K_SpawnBumpForObjs(mobj_t *mobj1, mobj_t *mobj2)
}
}
static void K_PlayerJustBumped(player_t *player)
void K_PlayerJustBumped(player_t *player)
{
mobj_t *playerMobj = NULL;

View file

@ -107,6 +107,7 @@ boolean K_TimeAttackRules(void);
boolean K_CapsuleTimeAttackRules(void);
fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against);
void K_PlayerJustBumped(player_t *player);
boolean K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2);
boolean K_KartSolidBounce(mobj_t *bounceMobj, mobj_t *solidMobj);
void K_KartPainEnergyFling(player_t *player);

View file

@ -3676,6 +3676,17 @@ static int lib_kGetMobjWeight(lua_State *L)
return 1;
}
static int lib_kPlayerJustBumped(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
NOHUD
INLEVEL
if (!player)
return LUA_ErrInvalid(L, "player_t");
K_PlayerJustBumped(player);
return 0;
}
static int lib_kKartBouncing(lua_State *L)
{
mobj_t *mobj1 = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
@ -5535,6 +5546,7 @@ static luaL_Reg lib[] = {
{"K_GetKartGameSpeedScalar",lib_kGetKartGameSpeedScalar},
{"K_IsPlayerWanted",lib_kIsPlayerWanted},
{"K_GetMobjWeight",lib_kGetMobjWeight},
{"K_PlayerJustBumped",lib_kPlayerJustBumped},
{"K_KartBouncing",lib_kKartBouncing},
{"K_KartPainEnergyFling",lib_kKartPainEnergyFling},
{"K_FlipFromObject",lib_kFlipFromObject},