diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index b6a4ba33c..02eec0963 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -13076,8 +13076,26 @@ restart_grand: if (clipyou != 0) { - if ((pos->z > daz) && (daz > *ceilz)) { *ceilz = daz; *ceilhit = j+49152; } - if ((pos->z < daz2) && (daz2 < *florz)) { *florz = daz2; *florhit = j+49152; } + if ((pos->z > daz) && (daz > *ceilz +#ifdef YAX_ENABLE + || (daz == *ceilz && yax_getbunch(clipsectorlist[i], YAX_CEILING)>=0) +#endif + )) + { + *ceilz = daz; + *ceilhit = j+49152; + } + + if ((pos->z < daz2) && (daz2 < *florz +#ifdef YAX_ENABLE + // can have a floor-sprite laying directly on the floor! + || (daz2 == *florz && yax_getbunch(clipsectorlist[i], YAX_FLOOR)>=0) +#endif + )) + { + *florz = daz2; + *florhit = j+49152; + } } } }