From ef6958a5782a2c7ea9860828f3996465935f4252 Mon Sep 17 00:00:00 2001 From: Anonimus Date: Wed, 12 Nov 2025 07:13:40 -0500 Subject: [PATCH] KRF_HIDEFROMSPB This isn't a thing in v1 and I'm not sure why it was locked to the Thunder Shield for so long --- src/deh_tables.c | 1 + src/k_items.c | 9 +++++---- src/k_items.h | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/deh_tables.c b/src/deh_tables.c index f21e75111..422e60be9 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -1575,6 +1575,7 @@ struct int_const_s const INT_CONST[] = { {"KRF_NOTNEAREND",KRF_NOTNEAREND}, {"KRF_NOTFORBOTTOM",KRF_NOTFORBOTTOM}, {"KRF_RUNNERAUGMENT",KRF_RUNNERAUGMENT}, + {"KRF_HIDEFROMSPB",KRF_HIDEFROMSPB}, // kartspinoutflags_t {"KSPIN_THRUST",KSPIN_THRUST}, diff --git a/src/k_items.c b/src/k_items.c index b2da75a72..d9a336947 100644 --- a/src/k_items.c +++ b/src/k_items.c @@ -686,10 +686,6 @@ static INT32 GetItemOdds(kartroulette_t *roulette, kartresult_t *result, UINT8 * } } break; - case KITEM_THUNDERSHIELD: - if (spbplace != -1) - newodds = 0; - break; default: break; } @@ -744,6 +740,11 @@ static INT32 GetItemOdds(kartroulette_t *roulette, kartresult_t *result, UINT8 * // This item should not appear for losing players. (Usually items that feel less effective at these positions) newodds = 0; } + else if (flags & KRF_HIDEFROMSPB && (spbplace != -1)) + { + // This item doesn't appear if an SPB is chasing a player. + newodds = 0; + } else if (flags & KRF_POWERITEM) { // This item is a "power item". This activates "frantic item" toggle related functionality. diff --git a/src/k_items.h b/src/k_items.h index 74cc589e5..eb817d6ff 100644 --- a/src/k_items.h +++ b/src/k_items.h @@ -74,6 +74,7 @@ typedef enum KRF_NOTNEAREND = 1<<3, // This result should not appear at the end of a race. (Usually trap items that lose their effectiveness) KRF_NOTFORBOTTOM = 1<<4, // After the first 30 seconds, this result stops appearing for losing players. (Usually items that feel less effective at these positions) KRF_RUNNERAUGMENT = 1<<5, // This result's odds are affected by the severity of 1st place's frontrun. (Very likely only for SPBs, but who knows?) + KRF_HIDEFROMSPB = 1<<6, // This result refuses to appear when a Self-Propelled Bomb is active in a race or battle. } ATTRPACK kartresultflags_e; // Unique useodds function