From 983a9dbd6056d43f8c31771af2a4aafca056541d Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 19 Jul 2018 01:11:21 -0400 Subject: [PATCH] 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. --- src/p_map.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 29b84cc3e..fee4c388b 100644 --- a/src/p_map.c +++ b/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;