Merge branch 'fix-whip-clash' into 'master'

Let Insta-Whip clashing ignore flashing tics

Closes #978

See merge request KartKrew/Kart!1870
This commit is contained in:
Oni 2024-02-03 19:43:11 +00:00
commit 39b5a8ac2f

View file

@ -848,12 +848,16 @@ boolean K_InstaWhipCollide(mobj_t *shield, mobj_t *victim)
{ {
player_t *victimPlayer = victim->player; player_t *victimPlayer = victim->player;
if (victim != attacker && (P_PlayerInPain(victimPlayer) ? victim->hitlag == 0 : victimPlayer->flashing == 0)) if (victim == attacker)
{ return false;
// If both players have a whip, hits are order-of-execution dependent and that sucks. // If both players have a whip, hits are order-of-execution dependent and that sucks.
// Player expectation is a clash here. // Player expectation is a clash here.
if (victimPlayer->whip && !P_MobjWasRemoved(victimPlayer->whip)) if (victimPlayer->whip && !P_MobjWasRemoved(victimPlayer->whip))
{ {
if (victim->hitlag != 0)
return false;
victimPlayer->whip->extravalue2 = 1; victimPlayer->whip->extravalue2 = 1;
shield->extravalue2 = 1; shield->extravalue2 = 1;
@ -869,6 +873,8 @@ boolean K_InstaWhipCollide(mobj_t *shield, mobj_t *victim)
return false; return false;
} }
if (P_PlayerInPain(victimPlayer) ? victim->hitlag == 0 : victimPlayer->flashing == 0)
{
// Instawhip _always_ loses to guard. // Instawhip _always_ loses to guard.
if (K_PlayerGuard(victimPlayer)) if (K_PlayerGuard(victimPlayer))
//if (true) //if (true)