From ec6ffbf0726857b23d9a278b25407e974576669b Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 10 Mar 2023 05:58:26 -0800 Subject: [PATCH] Let wombo damage work again Damage can't be ignored entirely while in hitlag because that defeats stacked hitlag (wombo combo). But it should be ignored if in an invincible state. --- src/p_inter.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index df9e69b71..7e5cc68ae 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2118,9 +2118,6 @@ 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 (!(damagetype & DMG_DEATHMASK) && (target->eflags & MFE_PAUSED)) - return false; } if (target->flags2 & MF2_SKULLFLY) @@ -2216,6 +2213,24 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da const INT32 oldHitlag = target->hitlag; const INT32 oldHitlagInflictor = inflictor ? inflictor->hitlag : 0; + // Damage during hitlag should be a no-op + // for invincibility states because there + // are no flashing tics. If the damage is + // from a constant source, a deadlock + // would occur. + + if (target->eflags & MFE_PAUSED) + { + player->timeshit--; // doesn't count + + if (playerInflictor) + { + playerInflictor->timeshit--; + } + + return false; + } + laglength = max(laglength / 2, 1); K_SetHitLagForObjects(target, inflictor, laglength, false);