From d67bba925508bfdcc56cfb9695c7a76a116b78db Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Mon, 25 Aug 2025 15:53:11 -0400 Subject: [PATCH 1/3] Fix SPB Attack and Class R attack replays --- src/g_game.c | 5 ++-- src/k_kart.c | 2 +- src/menus/play-local-race-time-attack.c | 38 +++++++++++++++++++++++++ src/p_setup.cpp | 15 +++++++++- 4 files changed, 55 insertions(+), 5 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 2f84b4ef0..71bd8a6a2 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -588,10 +588,9 @@ static void G_UpdateRecordReplays(void) { modeprefix = "spb-"; } - - if (K_LegacyRingboost(&players[consoleplayer])) + else if (K_LegacyRingboost(&players[consoleplayer])) { - modeprefix = "classr-"; + modeprefix = "hivolt-"; } if (players[consoleplayer].pflags & PF_NOCONTEST) diff --git a/src/k_kart.c b/src/k_kart.c index 4f175967b..70257be0e 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -9490,7 +9490,7 @@ boolean K_LegacyRingboost(player_t *player) return false; if (modeattacking == ATTACKING_SPB) return false; - if (!modeattacking) + if (!modeattacking || (modeattacking & ATTACKING_SPB)) return false; if (!(skins[player->skin]->flags & SF_HIVOLT)) return false; diff --git a/src/menus/play-local-race-time-attack.c b/src/menus/play-local-race-time-attack.c index 7ac7343bf..4c6569217 100644 --- a/src/menus/play-local-race-time-attack.c +++ b/src/menus/play-local-race-time-attack.c @@ -461,7 +461,17 @@ void M_ReplayTimeAttack(INT32 choice) const char *modeprefix = ""; if (cv_dummyspbattack.value) + { modeprefix = "spb-"; + } + else + { + const INT32 skinid = R_SkinAvailableEx(cv_skin[0].string, false); + if (skinid >= 0 && (skins[skinid]->flags & SF_HIVOLT)) + { + modeprefix = "hivolt-"; + } + } switch (choice) { @@ -521,7 +531,17 @@ static void M_WriteGuestReplay(INT32 ch) const char *modeprefix = ""; if (cv_dummyspbattack.value) + { modeprefix = "spb-"; + } + else + { + const INT32 skinid = R_SkinAvailableEx(cv_skin[0].string, false); + if (skinid >= 0 && (skins[skinid]->flags & SF_HIVOLT)) + { + modeprefix = "hivolt-"; + } + } if (TA_GuestReplay_Str != NULL) { @@ -580,7 +600,17 @@ void M_SetGuestReplay(INT32 choice) const char *modeprefix = ""; if (cv_dummyspbattack.value) + { modeprefix = "spb-"; + } + else + { + const INT32 skinid = R_SkinAvailableEx(cv_skin[0].string, false); + if (skinid >= 0 && (skins[skinid]->flags & SF_HIVOLT)) + { + modeprefix = "hivolt-"; + } + } if (FIL_FileExists(va("%s"PATHSEP"media"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%sguest.lmp", srb2home, timeattackfolder, G_BuildMapName(levellist.choosemap+1), modeprefix))) { @@ -622,6 +652,14 @@ void M_StartTimeAttack(INT32 choice) modeprefix = "spb-"; } + else + { + const INT32 skinid = R_SkinAvailableEx(cv_skin[0].string, false); + if (skinid >= 0 && (skins[skinid]->flags & SF_HIVOLT)) + { + modeprefix = "hivolt-"; + } + } // DON'T SOFTLOCK CON_ToggleOff(); diff --git a/src/p_setup.cpp b/src/p_setup.cpp index d62ce2b15..efd07f560 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -7816,6 +7816,7 @@ static void P_ResetSpawnpoints(void) static void P_TryAddExternalGhost(const char *defdemoname) { + CONS_Printf("trying %s\n", defdemoname); if (FIL_FileExists(defdemoname)) { savebuffer_t buf = {0}; @@ -7839,10 +7840,22 @@ static void P_LoadRecordGhosts(void) const char *modeprefix = ""; INT32 i; + CONS_Printf("trying load ghosts\n"); + gpath = Z_StrDup(va("%s" PATHSEP "media" PATHSEP "replay" PATHSEP "%s" PATHSEP "%s", srb2home, timeattackfolder, G_BuildMapName(gamemap))); if (encoremode) - modeprefix = "spb-"; + { + modeprefix = "-spb"; + } + else + { + const INT32 skinid = R_SkinAvailableEx(cv_skin[0].string, false); + if (skinid >= 0 && (skins[skinid]->flags & SF_HIVOLT)) + { + modeprefix = "-hivolt"; + } + } enum { From 0a94c2ac83fe47b1ac611f199cdc6c5e64568a65 Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Mon, 25 Aug 2025 16:24:16 -0400 Subject: [PATCH 2/3] Remove debug print --- src/p_setup.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index efd07f560..e011031e0 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -7816,7 +7816,6 @@ static void P_ResetSpawnpoints(void) static void P_TryAddExternalGhost(const char *defdemoname) { - CONS_Printf("trying %s\n", defdemoname); if (FIL_FileExists(defdemoname)) { savebuffer_t buf = {0}; @@ -7840,8 +7839,6 @@ static void P_LoadRecordGhosts(void) const char *modeprefix = ""; INT32 i; - CONS_Printf("trying load ghosts\n"); - gpath = Z_StrDup(va("%s" PATHSEP "media" PATHSEP "replay" PATHSEP "%s" PATHSEP "%s", srb2home, timeattackfolder, G_BuildMapName(gamemap))); if (encoremode) From a498ca732f73d28455cd0c0cf7d02cf9b1e7a610 Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Tue, 26 Aug 2025 00:51:52 -0400 Subject: [PATCH 3/3] Legacy Proration, force "Leader" splits for Class R --- src/g_demo.cpp | 6 +++++- src/k_kart.c | 5 ++++- src/k_kart.h | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/g_demo.cpp b/src/g_demo.cpp index 9307cd93b..7c7a580ac 100644 --- a/src/g_demo.cpp +++ b/src/g_demo.cpp @@ -2344,6 +2344,10 @@ void G_SetDemoCheckpointTiming(player_t *player, tic_t time, UINT8 checkpoint) boolean polite = (cv_attacksplits.value == 1); + // Class R doesn't have coherent times, just watch the leader. + if (K_LegacyRingboost(player)) + polite = false; + // "Next" Mode: Find the weakest ghost who beats our best time. // Don't set a ghost if we have no set time (oldbest == UINT32_MAX) if (polite) @@ -3577,7 +3581,7 @@ void G_AddGhost(savebuffer_t *buffer, const char *defdemoname) p++; // SUBVERSION ghostversion = READUINT16(p); - + if (ghostversion < MINDEMOVERSION || ghostversion > DEMOVERSION) { // too old, cannot support. diff --git a/src/k_kart.c b/src/k_kart.c index 70257be0e..22454c30e 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3108,6 +3108,9 @@ fixed_t K_PlayerTripwireSpeedThreshold(const player_t *player) { fixed_t required_speed = 2 * K_GetKartSpeed(player, false, false); // 200% + if (K_LegacyRingboost(player)) + return required_speed; + if (specialstageinfo.valid) required_speed = 3 * K_GetKartSpeed(player, false, false) / 2; // 150% @@ -9484,7 +9487,7 @@ static inline BlockItReturn_t PIT_AttractingRings(mobj_t *thing) return BMIT_CONTINUE; // find other rings } -boolean K_LegacyRingboost(player_t *player) +boolean K_LegacyRingboost(const player_t *player) { if (netgame) return false; diff --git a/src/k_kart.h b/src/k_kart.h index e7f4c56c9..483800777 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -46,7 +46,7 @@ Make sure this matches the actual number of states #define BAIL_MAXCHARGE (84) // tics to bail when in painstate nad in air, on ground is half, if you touch this, also update Obj_BailChargeThink synced animation logic #define BAIL_DROP (FRACUNIT) -#define BAIL_BOOST (6*FRACUNIT/5) +#define BAIL_BOOST (6*FRACUNIT/5) #define BAIL_CREDIT_DEBTRINGS (true) #define BAIL_DROPFREQUENCY (2) #define BAILSTUN (TICRATE*6) @@ -348,7 +348,7 @@ UINT16 K_GetEXP(player_t *player); UINT32 K_GetNumGradingPoints(void); -boolean K_LegacyRingboost(player_t *player); +boolean K_LegacyRingboost(const player_t *player); void K_BotHitPenalty(player_t *player);