From 4fe0dff8580c408b482126ed674f816034dcce3b Mon Sep 17 00:00:00 2001 From: yamamama Date: Mon, 29 Dec 2025 10:40:59 -0500 Subject: [PATCH] Add grandprixinfo.gp checks I forgot about --- src/d_netcmd.c | 2 +- src/k_bot.cpp | 20 +++++++++++++------- src/k_items.c | 6 +++--- src/k_kart.c | 2 +- src/p_setup.c | 4 +++- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 70f44b257..a0ee8516d 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -8496,7 +8496,7 @@ static void KartBumpSpark_OnChange(void) return; } - if (grandprixinfo.lunaticmode) + if ((grandprixinfo.gp == true) && (grandprixinfo.lunaticmode)) { CONS_Printf("No, no - lunatics don't need Bump Spark!\n"); bumpsparkactive = 0; diff --git a/src/k_bot.cpp b/src/k_bot.cpp index 6815059ce..27676af80 100644 --- a/src/k_bot.cpp +++ b/src/k_bot.cpp @@ -579,7 +579,7 @@ fixed_t K_BotMapModifier(void) //return 5*FRACUNIT/10; // ...with a bit of customization - if (grandprixinfo.lunaticmode == true) + if ((grandprixinfo.gp == true) && (grandprixinfo.lunaticmode == true)) return std::max(static_cast(BASELUNATICSPEEDMOD), K_TrackModifierMax()); return K_TrackModifierMax(); @@ -693,12 +693,18 @@ fixed_t K_BotRubberband(const player_t *player) ); // +/- x0.35 - const fixed_t rubberStretchiness = - FixedMul(FixedDiv(35 * FRACUNIT / 100, K_GetKartGameSpeedScalar(gamespeed)), - ((grandprixinfo.lunaticmode == true) && (player->botvars.rival == true)) - ? std::max(BASELUNATICRIVALSPEEDMOD, - K_BotMapModifier()) // The rival is faster on Lunatic mode. - : K_BotMapModifier()); + fixed_t botModifier = K_BotMapModifier(); + + if ((grandprixinfo.gp == true) && (grandprixinfo.lunaticmode == true)) + { + if (player->botvars.rival == true) + botModifier = + std::max(BASELUNATICRIVALSPEEDMOD, + K_BotMapModifier()); // The rival is faster on Lunatic mode. + } + + const fixed_t rubberStretchiness = FixedMul( + FixedDiv(35 * FRACUNIT / 100, K_GetKartGameSpeedScalar(gamespeed)), botModifier); // Lv. 1: x0.4 min // Lv. MAX: x0.85 min diff --git a/src/k_items.c b/src/k_items.c index 6a7746285..fa54fafd1 100644 --- a/src/k_items.c +++ b/src/k_items.c @@ -796,7 +796,7 @@ static INT32 GetItemOdds(kartroulette_t *roulette, kartresult_t *result, UINT8 * // These odds get stronger as 1st's frontrun increases. INT32 runner_distval = result->augcvar[aug_idx]->value; - if (grandprixinfo.lunaticmode == true) + if ((grandprixinfo.gp == true) && (grandprixinfo.lunaticmode == true)) { // Lunatic Mode: Divide this distance by 2.25 for // aggressive frontrun prevention. @@ -1567,7 +1567,7 @@ INT32 KO_AltInvinOdds(INT32 odds, const kartroulette_t *roulette, const kartresu UINT32 cdist = roulette->clusterDist; - if (grandprixinfo.lunaticmode) + if ((grandprixinfo.gp == true) && (grandprixinfo.lunaticmode)) { // I'm tired, boss. cdist = (9 * cdist / 5); @@ -1605,7 +1605,7 @@ INT32 KO_SPBRaceOdds(INT32 odds, const kartroulette_t *roulette, const kartresul UINT32 raceforce_pdis = roulette->pdis; - if (grandprixinfo.lunaticmode == true) + if ((grandprixinfo.gp == true) && (grandprixinfo.lunaticmode == true)) { // Multiply by 2.25 raceforce_pdis = FixedMul(raceforce_pdis, 9 * FRACUNIT / 2); diff --git a/src/k_kart.c b/src/k_kart.c index 32dfe7ff7..3dbd4753b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2534,7 +2534,7 @@ UINT16 K_GetInvincibilityTime(player_t *player) UINT32 cdist = player->distancefromcluster; - if (grandprixinfo.lunaticmode) + if ((grandprixinfo.gp == true) && (grandprixinfo.lunaticmode)) { // I'm tired, boss. cdist = (9 * cdist / 5); diff --git a/src/p_setup.c b/src/p_setup.c index 85fb9de83..d249ca7cc 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -8231,8 +8231,10 @@ static void P_InitLevelSettings(boolean reloadinggamestate) itemlistactive = true; // Lunatics don't need Bump Spark! - if (grandprixinfo.lunaticmode == false) + if ((grandprixinfo.gp == false) || (grandprixinfo.lunaticmode == false)) + { bumpsparkactive = (UINT8)cv_kartbumpspark.value; + } antibumptime = (tic_t)cv_kartantibump.value * TICRATE;