From 444e9ce7df496da40943258137d1e6746f3c1cc5 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 14 Jul 2017 17:01:13 +0100 Subject: [PATCH] Fix wall spikes being harmful from below, set initial destscale of base too just in case --- src/p_map.c | 4 ++-- src/p_mobj.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index cbe2513c0..e1f204a8c 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -969,7 +969,7 @@ static boolean PIT_CheckThing(mobj_t *thing) else topz += FixedMul(FRACUNIT, tmthing->scale); - if (thing->z + thing->height >= bottomz // above bottom + if (thing->z + thing->height > bottomz // above bottom && thing->z < topz) // below top { // don't check angle, the player was clearly in the way in this case P_DamageMobj(thing, tmthing, tmthing, 1, DMG_SPIKE); @@ -985,7 +985,7 @@ static boolean PIT_CheckThing(mobj_t *thing) else topz += FixedMul(FRACUNIT, thing->scale); - if (tmthing->z + tmthing->height >= bottomz // above bottom + if (tmthing->z + tmthing->height > bottomz // above bottom && tmthing->z < topz // below top && !P_MobjWasRemoved(thing->tracer)) // this probably wouldn't work if we didn't have a tracer { // use base as a reference point to determine what angle you touched the spike at diff --git a/src/p_mobj.c b/src/p_mobj.c index bb62e4e9d..559f746a5 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8484,6 +8484,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) mobj->y - P_ReturnThrustY(mobj, mobj->angle, mobj->radius/2 - FixedMul(FRACUNIT, mobj->scale)), mobj->z, MT_WALLSPIKEBASE); base->angle = mobj->angle + ANGLE_90; + base->destscale = mobj->destscale; P_SetScale(base, mobj->scale); P_SetTarget(&base->target, mobj); P_SetTarget(&mobj->tracer, base);