From 4d0b0f84b1b2bc35ab47505797773e297e60f272 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Mon, 10 Jun 2019 14:10:37 +0200 Subject: [PATCH] Pushables that are also vulnerable no longer block crushers (because they die anyway). This allows us to make TNT barrels pushable again. --- src/info.c | 2 +- src/p_map.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/info.c b/src/info.c index 6f6ad140a..659e883a5 100644 --- a/src/info.c +++ b/src/info.c @@ -11619,7 +11619,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 100, // mass 0, // damage sfx_s3k8d, // activesound - MF_SOLID|MF_SHOOTABLE|MF_ENEMY, // flags + MF_SOLID|MF_SHOOTABLE|MF_ENEMY|MF_PUSHABLE, // flags S_NULL // raisestate }, diff --git a/src/p_map.c b/src/p_map.c index dbcb80f51..ca4548d0b 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3894,6 +3894,8 @@ static boolean nofit; static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush) { mobj_t *killer = NULL; + //If a thing is both pushable and vulnerable, it doesn't block the crusher because it gets killed. + boolean immunepushable = ((thing->flags & (MF_PUSHABLE | MF_SHOOTABLE)) == MF_PUSHABLE); if (P_ThingHeightClip(thing)) { @@ -3912,7 +3914,7 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush) // just be blocked by another object - check if it's really a ceiling! if (thing->z + thing->height > thing->ceilingz && thing->z <= thing->ceilingz) { - if (thing->flags & MF_PUSHABLE && thing->z + thing->height > thing->subsector->sector->ceilingheight) + if (immunepushable && thing->z + thing->height > thing->subsector->sector->ceilingheight) { //Thing is a pushable and blocks the moving ceiling nofit = true; @@ -3920,7 +3922,7 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush) } //Check FOFs in the sector - if (thing->subsector->sector->ffloors && (realcrush || thing->flags & MF_PUSHABLE)) + if (thing->subsector->sector->ffloors && (realcrush || immunepushable)) { ffloor_t *rover; fixed_t topheight, bottomheight; @@ -3947,7 +3949,7 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush) delta2 = thingtop - (bottomheight + topheight)/2; if (bottomheight <= thing->ceilingz && abs(delta1) >= abs(delta2)) { - if (thing->flags & MF_PUSHABLE) + if (immunepushable) { //FOF is blocked by pushable nofit = true;