From 139253a8c2e88a3b421a9b92f1bb1e067d1c6d17 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 16 Oct 2020 16:40:57 -0700 Subject: [PATCH] Offset slope anchors from regular slopes --- src/slope_anchors.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/slope_anchors.c b/src/slope_anchors.c index 51a567f19..69dc504a6 100644 --- a/src/slope_anchors.c +++ b/src/slope_anchors.c @@ -118,13 +118,16 @@ anchor_height const mapthing_t * a, const sector_t * s ){ + const fixed_t x = a->x << FRACBITS; + const fixed_t y = a->y << FRACBITS; + if (a->options & MTF_OBJECTFLIP) { - return ( s->ceilingheight >> FRACBITS ) - a->z; + return ( P_GetSectorCeilingZAt(s, x, y) >> FRACBITS ) - a->z; } else { - return ( s->floorheight >> FRACBITS ) + a->z; + return ( P_GetSectorFloorZAt(s, x, y) >> FRACBITS ) + a->z; } } @@ -144,13 +147,13 @@ set_anchor fixed_t closeness; - a->z = anchor_height(a, sub->sector); - v = nearest_point(&closeness, a, sub->sector); a->x = ( v->x >> FRACBITS ); a->y = ( v->y >> FRACBITS ); + a->z = anchor_height(a, sub->sector); + list->anchors [list->count] = a; list->points [list->count] = v; list->closeness[list->count] = closeness;