diff --git a/src/p_map.c b/src/p_map.c
index 2a7b51abdff548c268ce92ed34bd3fc87eeae5cb..f2faf29b6958d50355c615e42d0a5e6dc6b54fcb 100644
--- a/src/p_map.c
+++ b/src/p_map.c
@@ -2744,7 +2744,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
 			}
 			else if (tmceilingz < thingtop)
 			{
-				if (tmceilingz - thingtop <= maxstep)
+				if (thingtop - tmceilingz <= maxstep)
 				{
 					thing->z = ( thing->ceilingz = tmceilingz ) - thing->height;
 					thing->ceilingrover = tmceilingrover;