- 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.
This commit is contained in:
Christoph Oelckers 2022-09-16 19:03:23 +02:00
parent e2954dd9d5
commit a3d1420426

View file

@ -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) bool CheckProximityWall(walltype* pWall, int x, int y, int nDist)
{ {
int x1 = pWall->wall_int_pos().X; int x1 = pWall->pos.X * (1./maptoworld);
int y1 = pWall->wall_int_pos().Y; int y1 = pWall->pos.Y * (1./maptoworld);
int x2 = pWall->point2Wall()->wall_int_pos().X; int x2 = pWall->point2Wall()->pos.X * (1./maptoworld);
int y2 = pWall->point2Wall()->wall_int_pos().Y; int y2 = pWall->point2Wall()->pos.Y * (1./maptoworld);
nDist <<= 4; nDist <<= 4;
if (x1 < x2) if (x1 < x2)
{ {