Fix wall spikes being harmful from below, set initial destscale of base too just in case

This commit is contained in:
Monster Iestyn 2017-07-14 17:01:13 +01:00
parent eacf753f2c
commit 444e9ce7df
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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);