From a3d1420426a854d409f76e30291513b8322bf46e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 16 Sep 2022 19:03:23 +0200 Subject: [PATCH] - remove int wrappers from CheckProximityWall As laid out in the comment, the function is broken and only kept for compatibility purposes. Therefore it may not be refactored in any way and should retain its incorrect and often overflowing int math. The wrappers are only a refactoring marker and have no place here. --- source/games/blood/src/gameutil.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/games/blood/src/gameutil.cpp b/source/games/blood/src/gameutil.cpp index 55a83d51d..367ca612f 100644 --- a/source/games/blood/src/gameutil.cpp +++ b/source/games/blood/src/gameutil.cpp @@ -94,10 +94,10 @@ bool CheckProximityPoint(int nX1, int nY1, int nZ1, int nX2, int nY2, int nZ2, i bool CheckProximityWall(walltype* pWall, int x, int y, int nDist) { - int x1 = pWall->wall_int_pos().X; - int y1 = pWall->wall_int_pos().Y; - int x2 = pWall->point2Wall()->wall_int_pos().X; - int y2 = pWall->point2Wall()->wall_int_pos().Y; + int x1 = pWall->pos.X * (1./maptoworld); + int y1 = pWall->pos.Y * (1./maptoworld); + int x2 = pWall->point2Wall()->pos.X * (1./maptoworld); + int y2 = pWall->point2Wall()->pos.Y * (1./maptoworld); nDist <<= 4; if (x1 < x2) {