diff --git a/src/p_enemy.c b/src/p_enemy.c index 762a0454b..dc65d4e72 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -407,11 +407,25 @@ static boolean P_Move(mobj_t *actor, boolean dropoff) // killough 9/12/98 if (actor->flags & MF_FLOAT && floatok) { + const mobj_t *onmo; // [Nugget] + if (actor->z < tmfloorz) // must adjust height - actor->z += FLOATSPEED; + { + actor->z += FLOATSPEED; + + // [Nugget] + if ((onmo = P_CheckOnmobj(actor))) + { actor->z = onmo->z - actor->height; } + } else + { actor->z -= FLOATSPEED; + // [Nugget] + if ((onmo = P_CheckOnmobj(actor))) + { actor->z = onmo->z + onmo->height; } + } + actor->flags |= MF_INFLOAT; return true; diff --git a/src/p_map.c b/src/p_map.c index 2b7ff2e4e..5ed314ae7 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2548,7 +2548,9 @@ mobj_t *P_CheckOnmobj(mobj_t *thing) { int xl, xh, yl, yh, bx, by; subsector_t *newsubsec; - mobj_t oldmo = *thing; // Save the old mobj before the fake movement + const mobj_t oldmo = *thing; // Save the old mobj before the fake movement + + if (!(casual_play && over_under)) { return NULL; } tmx = thing->x; tmy = thing->y;