Merge branch 'misc-fixes-tomerge' into 'next'

Miscellanous fixes to merge

These are the commits from the "miscellanous-fixes" branch that are okay to merge in.

Bugs fixed include the following:
* CTF flags respawning incorrectly: they cannot z position themselves correctly, and they cannot flip themselves.
* The weird "jumping" spring/monitor effect: this is the result of an internal mobj_t pointer (tmfloorthing, specifically) not resetting itself to NULL for the next object's thinker, resulting in Z movement code thrusting the object vertically at tmfloorthing->momz.

See merge request !18
This commit is contained in:
Alam Ed Arias 2015-06-18 09:51:59 -04:00
commit f7747f43ba
3 changed files with 12 additions and 7 deletions

View file

@ -276,7 +276,7 @@ boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed
extern boolean floatok; extern boolean floatok;
extern fixed_t tmfloorz; extern fixed_t tmfloorz;
extern fixed_t tmceilingz; extern fixed_t tmceilingz;
extern mobj_t *tmfloorthing, *tmthing; extern mobj_t *tmfloorthing, *tmhitthing, *tmthing;
extern camera_t *mapcampointer; extern camera_t *mapcampointer;
/* cphipps 2004/08/30 */ /* cphipps 2004/08/30 */

View file

@ -47,7 +47,7 @@ boolean floatok;
fixed_t tmfloorz, tmceilingz; fixed_t tmfloorz, tmceilingz;
static fixed_t tmdropoffz, tmdrpoffceilz; // drop-off floor/ceiling heights static fixed_t tmdropoffz, tmdrpoffceilz; // drop-off floor/ceiling heights
mobj_t *tmfloorthing; // the thing corresponding to tmfloorz or NULL if tmfloorz is from a sector mobj_t *tmfloorthing; // the thing corresponding to tmfloorz or NULL if tmfloorz is from a sector
static mobj_t *tmhitthing; // the solid thing you bumped into (for collisions) mobj_t *tmhitthing; // the solid thing you bumped into (for collisions)
// keep track of the line that lowers the ceiling, // keep track of the line that lowers the ceiling,
// so missiles don't explode against sky hack walls // so missiles don't explode against sky hack walls

View file

@ -5450,6 +5450,8 @@ void P_MobjThinker(mobj_t *mobj)
mobj->eflags &= ~(MFE_PUSHED|MFE_SPRUNG); mobj->eflags &= ~(MFE_PUSHED|MFE_SPRUNG);
tmfloorthing = tmhitthing = NULL;
// 970 allows ANY mobj to trigger a linedef exec // 970 allows ANY mobj to trigger a linedef exec
if (mobj->subsector && GETSECSPECIAL(mobj->subsector->sector->special, 2) == 8) if (mobj->subsector && GETSECSPECIAL(mobj->subsector->sector->special, 2) == 8)
{ {
@ -6497,19 +6499,22 @@ void P_MobjThinker(mobj_t *mobj)
if (mobj->spawnpoint->options & MTF_OBJECTFLIP) if (mobj->spawnpoint->options & MTF_OBJECTFLIP)
{ {
z = ss->sector->ceilingheight - mobjinfo[mobj->type].height; z = ss->sector->ceilingheight - mobjinfo[mobj->type].height;
if (mobj->spawnpoint->z) if (mobj->spawnpoint->options >> ZSHIFT)
z -= mobj->spawnpoint->z << FRACBITS; z -= (mobj->spawnpoint->options >> ZSHIFT) << FRACBITS;
} }
else else
{ {
z = ss->sector->floorheight; z = ss->sector->floorheight;
if (mobj->spawnpoint->z) if (mobj->spawnpoint->options >> ZSHIFT)
z += mobj->spawnpoint->z << FRACBITS; z += (mobj->spawnpoint->options >> ZSHIFT) << FRACBITS;
} }
flagmo = P_SpawnMobj(x, y, z, mobj->type); flagmo = P_SpawnMobj(x, y, z, mobj->type);
flagmo->spawnpoint = mobj->spawnpoint; flagmo->spawnpoint = mobj->spawnpoint;
if (mobj->spawnpoint->options & MTF_OBJECTFLIP) if (mobj->spawnpoint->options & MTF_OBJECTFLIP)
flagmo->spawnpoint->options |= MTF_OBJECTFLIP; {
flagmo->eflags |= MFE_VERTICALFLIP;
flagmo->flags2 |= MF2_OBJECTFLIP;
}
if (mobj->type == MT_REDFLAG) if (mobj->type == MT_REDFLAG)
{ {