From 5f66cf3398c1c642d17bfefdd4f8d0ec9f7d53fe Mon Sep 17 00:00:00 2001 From: Vladimir Olteanu Date: Wed, 2 Jun 2021 10:42:18 +0300 Subject: [PATCH] Use WalkingDistance in LeftMouseCmd --- Source/diablo.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index fbdfe3ef3..fb2aa1157 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -807,8 +807,7 @@ static bool LeftMouseCmd(bool bShift) return true; } else { auto &myPlayer = plr[myplr]; - Point delta = abs(myPlayer.position.tile - Point { cursmx, cursmy }); - bNear = delta.x < 2 && delta.y < 2; + bNear = myPlayer.position.tile.WalkingDistance({ cursmx, cursmy }) < 2; if (pcursitem != -1 && pcurs == CURSOR_HAND && !bShift) { NetSendCmdLocParam1(true, invflag ? CMD_GOTOGETITEM : CMD_GOTOAGETITEM, { cursmx, cursmy }, pcursitem); } else if (pcursobj != -1 && (!objectIsDisabled(pcursobj)) && (!bShift || (bNear && object[pcursobj]._oBreak == 1))) {