mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-01-10 00:34:32 +00:00
Use simpler logic for squishing other players
Instead of comparing k_growshrinktimer in awkward ways, just make sure the squishing player's scale is high enough above the victim's scale. This way, we can allow shrunk players to bump other shrunk players, and grown players to bump other grown players.
This commit is contained in:
parent
f1d21b008d
commit
50711ce0b5
1 changed files with 8 additions and 14 deletions
22
src/p_map.c
22
src/p_map.c
|
|
@ -1535,16 +1535,10 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
&& !(thing->z + thing->height < tmthing->z || thing->z > tmthing->z + tmthing->height))
|
||||
{
|
||||
// SRB2kart - Squish!
|
||||
if ((tmthing->player->kartstuff[k_growshrinktimer] > 0 && thing->player->kartstuff[k_growshrinktimer] <= 0)
|
||||
|| (tmthing->player->kartstuff[k_growshrinktimer] == 0 && thing->player->kartstuff[k_growshrinktimer] < 0))
|
||||
{
|
||||
if (tmthing->scale > thing->scale + (FRACUNIT/8))
|
||||
K_SquishPlayer(thing->player, tmthing);
|
||||
}
|
||||
else if ((thing->player->kartstuff[k_growshrinktimer] > 0 && tmthing->player->kartstuff[k_growshrinktimer] <= 0)
|
||||
|| (thing->player->kartstuff[k_growshrinktimer] == 0 && tmthing->player->kartstuff[k_growshrinktimer] < 0))
|
||||
{
|
||||
else if (thing->scale > tmthing->scale + (FRACUNIT/8))
|
||||
K_SquishPlayer(tmthing->player, thing);
|
||||
}
|
||||
|
||||
// SRB2kart - Starpower!
|
||||
if (tmthing->player->kartstuff[k_invincibilitytimer] && !thing->player->kartstuff[k_invincibilitytimer])
|
||||
|
|
@ -1641,13 +1635,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
|||
if (tmthing->z + tmthing->height < thing->z)
|
||||
return true; // underneath
|
||||
|
||||
if (thing->player->kartstuff[k_growshrinktimer] || thing->player->kartstuff[k_squishedtimer]
|
||||
|| thing->player->kartstuff[k_hyudorotimer] || thing->player->kartstuff[k_spinouttimer]
|
||||
|| thing->player->kartstuff[k_invincibilitytimer] || thing->player->kartstuff[k_justbumped]
|
||||
if (thing->player->kartstuff[k_spinouttimer] || thing->player->kartstuff[k_squishedtimer]
|
||||
|| thing->player->kartstuff[k_hyudorotimer] || thing->player->kartstuff[k_invincibilitytimer]
|
||||
|| thing->player->kartstuff[k_justbumped] || thing->scale > tmthing->scale + (FRACUNIT/8)
|
||||
|| (G_BattleGametype() && thing->player->kartstuff[k_bumper] <= 0)
|
||||
|| tmthing->player->kartstuff[k_growshrinktimer] || tmthing->player->kartstuff[k_squishedtimer]
|
||||
|| tmthing->player->kartstuff[k_hyudorotimer] || tmthing->player->kartstuff[k_spinouttimer]
|
||||
|| tmthing->player->kartstuff[k_invincibilitytimer] || tmthing->player->kartstuff[k_justbumped]
|
||||
|| tmthing->player->kartstuff[k_spinouttimer] || tmthing->player->kartstuff[k_squishedtimer]
|
||||
|| tmthing->player->kartstuff[k_hyudorotimer] || tmthing->player->kartstuff[k_invincibilitytimer]
|
||||
|| tmthing->player->kartstuff[k_justbumped] || tmthing->scale > thing->scale + (FRACUNIT/8)
|
||||
|| (G_BattleGametype() && tmthing->player->kartstuff[k_bumper] <= 0))
|
||||
{
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue