diff --git a/src/p_map.c b/src/p_map.c
index 81bf9ebeec653ed9ea3a323f2c4e44efa769df05..f319acea81e126c9b101ddf93af76b0b7f1dd55e 100644
--- a/src/p_map.c
+++ b/src/p_map.c
@@ -4000,6 +4000,11 @@ fixed_t P_FloorzAtPos(fixed_t x, fixed_t y, fixed_t z, fixed_t height)
 	sector_t *sec = R_PointInSubsector(x, y)->sector;
 	fixed_t floorz = sec->floorheight;
 
+#ifdef ESLOPE
+	if (sec->f_slope)
+		floorz = P_GetZAt(sec->f_slope, x, y);
+#endif
+
 	// Intercept the stupid 'fall through 3dfloors' bug Tails 03-17-2002
 	if (sec->ffloors)
 	{