From 5b50236d188fdae9c42f383839f61d5ce26a677a Mon Sep 17 00:00:00 2001 From: nukeykt Date: Sat, 9 Nov 2019 01:15:00 +0900 Subject: [PATCH] Fix movement issues when emulating old engine code --- source/build/src/clip.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/source/build/src/clip.cpp b/source/build/src/clip.cpp index 7cbc9cbf7..08ec7dc23 100644 --- a/source/build/src/clip.cpp +++ b/source/build/src/clip.cpp @@ -778,10 +778,8 @@ static FORCE_INLINE void clipmove_tweak_pos(const vec3_t *pos, int32_t gx, int32 { int32_t daz; - if (enginecompatibility_mode == ENGINECOMPATIBILITY_19950829) - return; - - if (rintersect(pos->x, pos->y, 0, gx, gy, 0, x1, y1, x2, y2, daxptr, dayptr, &daz) == -1) + if (enginecompatibility_mode == ENGINECOMPATIBILITY_19950829 || + rintersect(pos->x, pos->y, 0, gx, gy, 0, x1, y1, x2, y2, daxptr, dayptr, &daz) == -1) { *daxptr = pos->x; *dayptr = pos->y; @@ -1454,7 +1452,7 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int if (templl > 0) { int64_t const templl2 = compat_maybe_truncate_to_int32((int64_t)(goal.x-vec.x)*clipr.x + (int64_t)(goal.y-vec.y)*clipr.y); - int32_t const i = enginecompatibility_mode == ENGINECOMPATIBILITY_19950829 || ((llabs(templl2)>>11) < templl) ? + int32_t const i = (enginecompatibility_mode == ENGINECOMPATIBILITY_19950829 || (llabs(templl2)>>11) < templl) ? divscale64(templl2, templl, 20) : 0; goal = { mulscale20(clipr.x, i)+vec.x, mulscale20(clipr.y, i)+vec.y };