diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index 38ef832c8..8dbda4d87 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -4947,16 +4947,17 @@ static void HWR_ProjectSprite(mobj_t *thing) if (heightsec != -1 && phs != -1) // only clip things which are in special sectors { fixed_t secheight; + const fixed_t fgzt = FloatToFixed(gzt); secheight = P_GetSectorFloorZAt(§ors[heightsec], viewx, viewy); if (viewz < P_GetSectorFloorZAt(§ors[phs], interp.x, interp.y) ? interp.z >= secheight : - gzt < secheight) + fgzt < secheight) return; secheight = P_GetSectorCeilingZAt(§ors[heightsec], viewx, viewy); if (viewz > P_GetSectorCeilingZAt(§ors[phs], interp.x, interp.y) ? - gzt < secheight && viewz >= secheight : + fgzt < secheight && viewz >= secheight : interp.z >= secheight) return; }