From c6ade27b6aac1483089240d7ccae04f450d92088 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 29 May 2015 14:59:13 +0100 Subject: [PATCH 1/2] Fixes to CTF flag respawning, particularly reverse gravity and z-positioning. --- src/p_mobj.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 081124b95..092005c43 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6497,19 +6497,22 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->spawnpoint->options & MTF_OBJECTFLIP) { z = ss->sector->ceilingheight - mobjinfo[mobj->type].height; - if (mobj->spawnpoint->z) - z -= mobj->spawnpoint->z << FRACBITS; + if (mobj->spawnpoint->options >> ZSHIFT) + z -= (mobj->spawnpoint->options >> ZSHIFT) << FRACBITS; } else { z = ss->sector->floorheight; - if (mobj->spawnpoint->z) - z += mobj->spawnpoint->z << FRACBITS; + if (mobj->spawnpoint->options >> ZSHIFT) + z += (mobj->spawnpoint->options >> ZSHIFT) << FRACBITS; } flagmo = P_SpawnMobj(x, y, z, mobj->type); flagmo->spawnpoint = mobj->spawnpoint; if (mobj->spawnpoint->options & MTF_OBJECTFLIP) - flagmo->spawnpoint->options |= MTF_OBJECTFLIP; + { + flagmo->eflags |= MFE_VERTICALFLIP; + flagmo->flags2 |= MF2_OBJECTFLIP; + } if (mobj->type == MT_REDFLAG) { From b88600dac6a3b0e3b0b94d3156517074aae746ba Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 31 May 2015 13:57:27 +0100 Subject: [PATCH 2/2] tmfloorthing and tmhitthing are set to NULL at the start of P_MobjThinker, preventing any weird cases of carrying over the previous mobj's floor object or such. This fixes the issue with upside-down springs shooting downwards if you touch another of its kind. Also fixes one of the issues with monitors in Icicle Falls (after you phase inside the East-most float-bob FOF's monitor via the other bug and jump up to break it while there, the NEXT monitor moves upwards too) --- src/p_local.h | 2 +- src/p_map.c | 2 +- src/p_mobj.c | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index 926a51788..59179c1c1 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -276,7 +276,7 @@ boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed extern boolean floatok; extern fixed_t tmfloorz; extern fixed_t tmceilingz; -extern mobj_t *tmfloorthing, *tmthing; +extern mobj_t *tmfloorthing, *tmhitthing, *tmthing; extern camera_t *mapcampointer; /* cphipps 2004/08/30 */ diff --git a/src/p_map.c b/src/p_map.c index c88b91e94..a29ae9512 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -47,7 +47,7 @@ boolean floatok; fixed_t tmfloorz, tmceilingz; 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 -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, // so missiles don't explode against sky hack walls diff --git a/src/p_mobj.c b/src/p_mobj.c index 092005c43..24a9f7b58 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -5450,6 +5450,8 @@ void P_MobjThinker(mobj_t *mobj) mobj->eflags &= ~(MFE_PUSHED|MFE_SPRUNG); + tmfloorthing = tmhitthing = NULL; + // 970 allows ANY mobj to trigger a linedef exec if (mobj->subsector && GETSECSPECIAL(mobj->subsector->sector->special, 2) == 8) {