Merge branch 'bubble-ballswitch' into 'master'

Limit ballswitch bubble contact to once per inflate (PF2_BUBBLECONTACT)

Closes #1578

See merge request kart-krew-dev/ring-racers-internal!2658
This commit is contained in:
Oni VelocitOni 2025-07-02 02:36:02 +00:00
commit 275fbb1476
3 changed files with 13 additions and 2 deletions

View file

@ -139,8 +139,9 @@ typedef enum
PF2_SELFDEAFEN = 1<<2,
PF2_SERVERMUTE = 1<<3,
PF2_SERVERDEAFEN = 1<<4,
PF2_STRICTFASTFALL = 1<<5,
PF2_ALWAYSDAMAGED = 1<<6,
PF2_STRICTFASTFALL = 1<<5, // Fastfall only with C, never with A+X. Profile preference.
PF2_ALWAYSDAMAGED = 1<<6, // Ignore invulnerability or clash conditions when evaulating damage (P_DamageMobj). Unset after use!
PF2_BUBBLECONTACT = 1<<7, // ACHTUNG VERY BAD HACK - Don't allow Bubble Shield to contact certain objects unless this is a fresh blowup.
} pflags2_t;
typedef enum

View file

@ -10654,6 +10654,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->bubblecool = 0;
}
if (player->bubbleblowup == 0)
player->pflags2 &= ~PF2_BUBBLECONTACT;
if (player->itemtype != KITEM_FLAMESHIELD)
{
if (player->flamedash)

View file

@ -214,6 +214,13 @@ struct BallSwitch_Ball : mobj_t
void Hit(mobj_t *inflictor, mobj_t *source)
{
if (inflictor->type == MT_BUBBLESHIELD && source->player)
{
if (source->player->pflags2 & PF2_BUBBLECONTACT)
return;
source->player->pflags2 |= PF2_BUBBLECONTACT;
}
Push(inflictor, 64 << FRACBITS, 1 << FRACBITS);
K_SetHitLagForObjects(this, inflictor, source, 4, true);