Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kill monsters special #18

Merged
merged 1 commit into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions prboom2/src/p_mobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions prboom2/src/p_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down