From 5e70789cdaf30f8abc1dc9d9b7db177757d35db9 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 17 Mar 2021 18:39:19 +0000 Subject: [PATCH] Prevent hitlag from eating death events (resolves #112). I could've used the existing `boolean force` here to skip over the check, but I think the MF_SHOOTABLE check is appropriate, and the DMG_CANTHURTSELF flag will be respected this way too. Also, clean up a ridiculously long statement. * `k_spinouttype` will never have the value of 2. This might've been a check for KSPIN_IFRAMES, but * that already controls `pw_flashing` earlier in the check * completely unlabeled, so it's nonsense that needs to be stripped * `k_squishedtimer` wa mou shinderu. --- src/p_inter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index 541d1a890..d29b687ec 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1863,7 +1863,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (!(target->flags & MF_SHOOTABLE)) return false; // shouldn't happen... - if (target->hitlag > 0) + if (!(damagetype & DMG_DEATHMASK) && target->hitlag > 0) return false; } @@ -1947,7 +1947,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (combo == false) { - if (player->powers[pw_flashing] > 0 || player->kartstuff[k_squishedtimer] > 0 || (player->kartstuff[k_spinouttimer] > 0 && player->kartstuff[k_spinouttype] != 2)) + if (player->powers[pw_flashing] > 0) { // Post-hit invincibility K_DoInstashield(player);