From a26f97198024c025e82457627b9c76409c5f7b86 Mon Sep 17 00:00:00 2001 From: NepDisk <16447892+NepDisk@users.noreply.github.com> Date: Sat, 14 Sep 2024 08:58:49 -0400 Subject: [PATCH] Fix MF_PAIN --- src/p_map.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index ede5a6038..bc977db93 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -598,28 +598,24 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) return BMIT_CONTINUE; // overhead if (thing->z + thing->height < tm.thing->z) return BMIT_CONTINUE; // underneath - if (tm.thing->flags & MF_SHOOTABLE && thing->health > 0) + if (tm.thing->player && tm.thing->flags & MF_SHOOTABLE && thing->health > 0) { - UINT32 damagetype = (thing->info->mass & 0xFF); - - if (P_DamageMobj(tm.thing, thing, thing, 1, damagetype) && (damagetype = (thing->info->mass>>8))) - S_StartSound(thing, damagetype); + UINT32 damagetype = (tm.thing->info->mass & DMG_TYPEMASK); + P_DamageMobj(tm.thing, thing, thing, 1, damagetype); } return BMIT_CONTINUE; } - else if (tm.thing->flags & MF_PAIN && thing->player) + else if (tm.thing->flags & MF_PAIN) { // Painful thing splats player in the face // see if it went over / under if (tm.thing->z > thing->z + thing->height) return BMIT_CONTINUE; // overhead if (tm.thing->z + tm.thing->height < thing->z) return BMIT_CONTINUE; // underneath - if (thing->flags & MF_SHOOTABLE && tm.thing->health > 0) + if (thing->player && thing->flags & MF_SHOOTABLE && tm.thing->health > 0) { UINT32 damagetype = (tm.thing->info->mass & 0xFF); - - if (P_DamageMobj(thing, tm.thing, tm.thing, 1, damagetype) && (damagetype = (tm.thing->info->mass>>8))) - S_StartSound(tm.thing, damagetype); + P_DamageMobj(thing, tm.thing, tm.thing, 1, damagetype); } return BMIT_CONTINUE; }