From acb197ddb2e3180b6325ffa775aa1a9ca83013a9 Mon Sep 17 00:00:00 2001 From: JugadorXEI Date: Tue, 5 Aug 2025 16:02:25 +0200 Subject: [PATCH] Expose K_GetKartGameSpeedScalar to Lua --- src/lua_baselib.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 0abcd51e8..e29c0d4d4 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -3563,6 +3563,13 @@ static int lib_kGetPlayerDontDrawFlag(lua_State *L) return 1; } +static int lib_kGetKartGameSpeedScalar(lua_State *L) +{ + SINT8 value = luaL_optinteger(L, 1, gamespeed); + lua_pushfixed(L, K_GetKartGameSpeedScalar(value)); + return 1; +} + static int lib_kIsPlayerWanted(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -4552,6 +4559,7 @@ static luaL_Reg lib[] = { {"K_TryHurtSoundExchange", lib_kTryHurtSoundExchange}, {"K_GetPlayerDontDrawFlag", lib_kGetPlayerDontDrawFlag}, {"K_IsPlayerLosing",lib_kIsPlayerLosing}, + {"K_GetKartGameSpeedScalar",lib_kGetKartGameSpeedScalar}, {"K_IsPlayerWanted",lib_kIsPlayerWanted}, {"K_GetMobjWeight",lib_kGetMobjWeight}, {"K_KartBouncing",lib_kKartBouncing},