Fix spindash check (player collision removes spindash!)

This commit is contained in:
Antonio Martinez 2025-09-02 23:16:39 -04:00
parent baa0868212
commit 67109e2da1
3 changed files with 9 additions and 2 deletions

View file

@ -151,6 +151,7 @@ typedef enum
PF2_SERVERTEMPMUTE = 1<<10, // Haven't met gamestochat requirement
PF2_SAMEFRAMESTUNG = 1<<11, // Goofy bullshit for tracking mutual ring sting
PF2_UNSTINGABLE = 1<<12, // Was bumped out of spindash
} pflags2_t;
typedef enum

View file

@ -1324,7 +1324,7 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
bool stung = false;
if (RINGTOTAL(t2->player) <= 0 && t2->health == 1 && t2->player->spindash == 0)
if (RINGTOTAL(t2->player) <= 0 && t2->health == 1 && !(t2->player->pflags2 & PF2_UNSTINGABLE))
{
P_DamageMobj(t2, t1, t1, 1, DMG_STING|DMG_WOMBO);
// CONS_Printf("T2 stung\n");

View file

@ -967,6 +967,7 @@ void K_PlayerJustBumped(player_t *player)
player->justbumped = bumptime;
player->noEbrakeMagnet = ebraketime;
player->spindash = 0;
// If spinouttimer is not set yet but could be set later,
@ -9833,9 +9834,14 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
K_SpawnGrowShrinkParticles(player->mo, player->growshrinktimer);
}
if (player->spindash)
player->pflags2 |= PF2_UNSTINGABLE;
else
player->pflags2 &= ~PF2_UNSTINGABLE;
// Race: spawn ring debt indicator
// Battle: spawn zero-bumpers indicator
if ((gametyperules & GTR_SPHERES) ? player->mo->health <= 1 : RINGTOTAL(player) <= 0)
if (!(player->pflags2 & PF2_UNSTINGABLE) && ((gametyperules & GTR_SPHERES) ? player->mo->health <= 1 : RINGTOTAL(player) <= 0))
{
UINT8 doubler;