From 1812a7295f0a96332fef1c165b7e6479b72dcde1 Mon Sep 17 00:00:00 2001 From: kraflab Date: Thu, 1 Apr 2021 19:08:47 +0200 Subject: [PATCH] Add kill monsters special --- prboom2/src/p_mobj.c | 20 ++++++++++++++++++++ prboom2/src/p_spec.h | 1 + 2 files changed, 21 insertions(+) diff --git a/prboom2/src/p_mobj.c b/prboom2/src/p_mobj.c index fee615a63..f116dcf8e 100644 --- a/prboom2/src/p_mobj.c +++ b/prboom2/src/p_mobj.c @@ -1058,6 +1058,26 @@ void P_MobjThinker (mobj_t* mobj) mobj->intflags &= ~MIF_FALLING, mobj->gear = 0; // Reset torque } + if (mbf21) + { + sector_t* sector = mobj->subsector->sector; + + if ( + sector->special & KILL_MONSTERS_MASK && + mobj->z == mobj->floorz && + mobj->player == NULL && + mobj->flags & MF_SHOOTABLE && + !(mobj->flags & MF_FLOAT) + ) + { + P_DamageMobj(mobj, NULL, NULL, 10000); + + // must have been removed + if (mobj->thinker.function != P_MobjThinker) + return; + } + } + // cycle through states, // calling action functions at transitions if (mobj->tics != -1) diff --git a/prboom2/src/p_spec.h b/prboom2/src/p_spec.h index 2862221d3..2829a7b39 100644 --- a/prboom2/src/p_spec.h +++ b/prboom2/src/p_spec.h @@ -94,6 +94,7 @@ #define DEATH_MASK 0x1000 // bit 12 #define DEATH_RADSUIT 0x20 // bit 5 #define DEATH_INVULN 0x40 // bit 6 +#define KILL_MONSTERS_MASK 0x2000 // bit 13 //jff 02/04/98 Define masks, shifts, for fields in // generalized linedef types