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.
This commit is contained in:
toaster 2021-03-17 18:39:19 +00:00
parent d2213c21a5
commit 5e70789cda

View file

@ -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);