When NIGHTSDRONE z changes, change DRONEMAN z as well

This commit is contained in:
mazmazz 2018-08-11 23:15:28 -04:00
parent 79c042ca09
commit 0c8e1aa10a
1 changed files with 7 additions and 4 deletions

View File

@ -7881,7 +7881,6 @@ void P_MobjThinker(mobj_t *mobj)
if (goalpost->destscale != mobj->destscale || goalpost->movefactor != mobj->z || flipchanged) if (goalpost->destscale != mobj->destscale || goalpost->movefactor != mobj->z || flipchanged)
{ {
goalpost->destscale = sparkle->destscale = droneman->destscale = mobj->destscale; goalpost->destscale = sparkle->destscale = droneman->destscale = mobj->destscale;
goalpost->movefactor = mobj->z;
// straight copy-pasta from P_SpawnMapThing, case MT_NIGHTSDRONE // straight copy-pasta from P_SpawnMapThing, case MT_NIGHTSDRONE
if (!flip) if (!flip)
@ -7937,6 +7936,11 @@ void P_MobjThinker(mobj_t *mobj)
P_TeleportMove(goalpost, mobj->x, mobj->y, mobj->z + goaloffset); P_TeleportMove(goalpost, mobj->x, mobj->y, mobj->z + goaloffset);
P_TeleportMove(sparkle, mobj->x, mobj->y, mobj->z + sparkleoffset); P_TeleportMove(sparkle, mobj->x, mobj->y, mobj->z + sparkleoffset);
if (goalpost->movefactor != mobj->z)
{
P_TeleportMove(droneman, mobj->x, mobj->y, mobj->z + dronemanoffset);
goalpost->movefactor = mobj->z;
}
} }
else if (goalpost->x != mobj->x || goalpost->y != mobj->y) else if (goalpost->x != mobj->x || goalpost->y != mobj->y)
{ {
@ -7945,11 +7949,10 @@ void P_MobjThinker(mobj_t *mobj)
} }
if (droneman->x != mobj->x || droneman->y != mobj->y) if (droneman->x != mobj->x || droneman->y != mobj->y)
{ // More complex changes like Z, gravity, and flags are handled earlier.
// we just care about x/y positioning; z takes care of itself // Here, we just care if only X/Y changes.
P_TeleportMove(droneman, mobj->x, mobj->y, P_TeleportMove(droneman, mobj->x, mobj->y,
droneman->z >= mobj->floorz && droneman->z <= mobj->ceilingz ? droneman->z : mobj->z); droneman->z >= mobj->floorz && droneman->z <= mobj->ceilingz ? droneman->z : mobj->z);
}
// now toggle states! // now toggle states!
// GOAL mode? // GOAL mode?