From 1eb1eabb75dacb62a9722a519562e180cc5377e6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 10 Sep 2022 19:05:24 +0200 Subject: [PATCH] - floatified SnapSectors --- source/games/exhumed/src/init.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/games/exhumed/src/init.cpp b/source/games/exhumed/src/init.cpp index f828ca9f0..86cc14930 100644 --- a/source/games/exhumed/src/init.cpp +++ b/source/games/exhumed/src/init.cpp @@ -215,17 +215,17 @@ void SnapSectors(sectortype* pSectorA, sectortype* pSectorB, int b) int bestx = 0x7FFFFFF; int besty = bestx; - int x = wal1.wall_int_pos().X; - int y = wal1.wall_int_pos().Y; + double x = wal1.pos.X; + int y = wal1.pos.Y; walltype* bestwall = nullptr; for(auto& wal2 : wallsofsector(pSectorB)) { - int thisx = x - wal2.wall_int_pos().X; - int thisy = y - wal2.wall_int_pos().Y; - int thisdist = abs(thisx) + abs(thisy); - int bestdist = abs(bestx) + abs(besty); + double thisx = x - wal2.pos.X; + double thisy = y - wal2.pos.Y; + double thisdist = abs(thisx) + abs(thisy); + double bestdist = abs(bestx) + abs(besty); if (thisdist < bestdist) { @@ -235,7 +235,7 @@ void SnapSectors(sectortype* pSectorA, sectortype* pSectorB, int b) } } - dragpoint(bestwall, bestwall->wall_int_pos().X + bestx, bestwall->wall_int_pos().Y + besty); + dragpoint(bestwall, bestwall->pos.X + bestx, bestwall->pos.Y + besty); } if (b) {