diff --git a/src/k_kart.c b/src/k_kart.c index eb7d7493..e56e7c96 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4660,7 +4660,7 @@ static void K_KartDrift(player_t *player, boolean onground) // // K_KartUpdatePosition // -static void K_KartUpdatePosition(player_t *player) +void K_KartUpdatePosition(player_t *player) { fixed_t position = 1; fixed_t oldposition = player->kartstuff[k_position]; diff --git a/src/k_kart.h b/src/k_kart.h index 3edbf0bd..864a8609 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -49,6 +49,7 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source); boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y); INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue); INT32 K_GetKartDriftSparkValue(player_t *player); +void K_KartUpdatePosition(player_t *player); void K_DropItems(player_t *player); void K_StripItems(player_t *player); void K_StripOther(player_t *player); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 1c14093c..bc41183f 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -2386,6 +2386,16 @@ static int lib_kGetKartDriftSparkValue(lua_State *L) return 1; } +static int lib_kKartUpdatePosition(lua_State *L) +{ + player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); + NOHUD + if (!player) + return LUA_ErrInvalid(L, "player_t"); + K_KartUpdatePosition(player); + return 0; +} + static int lib_kDropItems(lua_State *L) { player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); @@ -2677,6 +2687,7 @@ static luaL_Reg lib[] = { {"K_RepairOrbitChain",lib_kRepairOrbitChain}, {"K_FindJawzTarget",lib_kFindJawzTarget}, {"K_GetKartDriftSparkValue",lib_kGetKartDriftSparkValue}, + {"K_KartUpdatePosition",lib_kKartUpdatePosition}, {"K_DropItems",lib_kDropItems}, {"K_StripItems",lib_kStripItems}, {"K_StripOther",lib_kStripOther}, diff --git a/src/p_user.c b/src/p_user.c index da3df233..79e0cad7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1778,6 +1778,9 @@ void P_DoPlayerExit(player_t *player) if (G_RaceGametype()) // If in Race Mode, allow { + player->exiting = raceexittime+2; + K_KartUpdatePosition(player); + if (cv_kartvoices.value) { if (P_IsLocalPlayer(player)) @@ -1798,8 +1801,6 @@ void P_DoPlayerExit(player_t *player) } } - player->exiting = raceexittime+2; - if (cv_inttime.value > 0) P_EndingMusic(player);