From 57c5fa3cd77aa62484331466855daec9ac051b61 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 28 Aug 2025 15:01:54 +0100 Subject: [PATCH] Replace new gametype-specific checks with gametyperule checks - K_PlayerTripwireSpeedThreshold, K_CheckpointCrossAward - repaced with "GTR_CIRCUIT and not K_Cooperative" - excludes Sealed Stars as before, but includes custom Race-based gametypes - UFO Spawner tracking on minimap - GTR_PAPERITEMS, per how UFOs are handled in k_battle.c - G_RandMapPerPlayerCount: Check for the absence of GT_SPECIAL when excluding LF_SECTIONRACE, not the presence of GT_RACE - Little bit of a hack, but right now there's no way to do custom cooperative gametypes, we don't have proper access to gametyperules in this function, and Battle courses aren't going to have this flag anyways --- src/g_game.c | 6 +++++- src/k_hud.cpp | 2 +- src/k_kart.c | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 31cd80b9a..204d6ed84 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3932,7 +3932,11 @@ tryAgain: continue; } - if (numPlayers == 2 && gametype == GT_RACE && ((mapheaderinfo[i]->levelflags & LF_SECTIONRACE) == LF_SECTIONRACE)) + // TODO - We don't have guaranteed access to gametype/rules of TOL. + // If revising in future and willing to break this function open, + // this should be checking for GTR_CIRCUIT and not cooperative + // (but K_Cooperative also won't be correct inside this func). + if (numPlayers == 2 && gametype != GT_SPECIAL && ((mapheaderinfo[i]->levelflags & LF_SECTIONRACE) == LF_SECTIONRACE)) { // Duel doesn't support sprints. continue; diff --git a/src/k_hud.cpp b/src/k_hud.cpp index 9734d8cdc..4f91c412f 100644 --- a/src/k_hud.cpp +++ b/src/k_hud.cpp @@ -6448,7 +6448,7 @@ static void K_drawKartMinimap(void) } } - if (gametype == GT_BATTLE && Obj_GetNextUFOSpawner() != NULL) + if ((gametyperules & GTR_PAPERITEMS) && Obj_GetNextUFOSpawner() != NULL) { const INT32 prevsplitflags = splitflags; mobj_t *spawner = Obj_GetNextUFOSpawner(); diff --git a/src/k_kart.c b/src/k_kart.c index d21e15cdc..589d0ecf7 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3119,7 +3119,7 @@ fixed_t K_PlayerTripwireSpeedThreshold(const player_t *player) UINT32 distance = K_GetItemRouletteDistance(player, 8); - if (gametype == GT_RACE && M_NotFreePlay() && !modeattacking) + if ((gametyperules & GTR_CIRCUIT) && !K_Cooperative() && M_NotFreePlay() && !modeattacking) { if (distance < SCAMDIST) // Players near 1st need more speed! { @@ -4618,7 +4618,7 @@ static void K_HandleRaceSplits(player_t *player, tic_t time, UINT8 checkpoint) void K_CheckpointCrossAward(player_t *player) { - if (gametype != GT_RACE) + if (!(gametyperules & GTR_CIRCUIT) || K_Cooperative()) return; if (!demo.playback && G_TimeAttackStart())