Make Drone visual elements react to height change

This commit is contained in:
mazmazz 2018-08-13 09:50:50 -04:00
parent 1bc5976534
commit 6585ca3df3

View file

@ -7880,6 +7880,7 @@ void P_MobjThinker(mobj_t *mobj)
if (goalpost->destscale != mobj->destscale if (goalpost->destscale != mobj->destscale
|| goalpost->movefactor != mobj->z || goalpost->movefactor != mobj->z
|| goalpost->friction != mobj->height
|| flipchanged || flipchanged
|| goalpost->threshold != (mobj->flags & (MF_SLIDEME | MF_GRENADEBOUNCE))) || goalpost->threshold != (mobj->flags & (MF_SLIDEME | MF_GRENADEBOUNCE)))
{ {
@ -7939,10 +7940,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) if (goalpost->movefactor != mobj->z || goalpost->friction != mobj->height)
{ {
P_TeleportMove(droneman, mobj->x, mobj->y, mobj->z + dronemanoffset); P_TeleportMove(droneman, mobj->x, mobj->y, mobj->z + dronemanoffset);
goalpost->movefactor = mobj->z; goalpost->movefactor = mobj->z;
goalpost->friction = mobj->height;
} }
goalpost->threshold = mobj->flags & (MF_SLIDEME | MF_GRENADEBOUNCE); goalpost->threshold = mobj->flags & (MF_SLIDEME | MF_GRENADEBOUNCE);
} }
@ -10790,6 +10792,7 @@ ML_EFFECT4 : Don't clip inside the ground
// Remember old Z position and flags for correction detection // Remember old Z position and flags for correction detection
goalpost->movefactor = mobj->z; goalpost->movefactor = mobj->z;
goalpost->friction = mobj->height;
goalpost->threshold = mobj->flags & (MF_SLIDEME | MF_GRENADEBOUNCE); goalpost->threshold = mobj->flags & (MF_SLIDEME | MF_GRENADEBOUNCE);
} }
break; break;