From fdf8a21885ee2cfa8f8bc94b09ff036e66cfc411 Mon Sep 17 00:00:00 2001 From: Vladimir Olteanu Date: Tue, 1 Jun 2021 08:59:23 +0300 Subject: [PATCH] Use Point::Absolute in On_ATTACKID --- Source/msg.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/msg.cpp b/Source/msg.cpp index 66b4337ce..9c171fb08 100644 --- a/Source/msg.cpp +++ b/Source/msg.cpp @@ -1763,9 +1763,8 @@ static DWORD On_ATTACKID(TCmd *pCmd, int pnum) auto *p = (TCmdParam1 *)pCmd; if (gbBufferMsgs != 1 && currlevel == plr[pnum].plrlevel) { - int distx = abs(plr[pnum].position.tile.x - monster[p->wParam1].position.future.x); - int disty = abs(plr[pnum].position.tile.y - monster[p->wParam1].position.future.y); - if (distx > 1 || disty > 1) + Point dist = (plr[pnum].position.tile - monster[p->wParam1].position.future).Absolute(); + if (dist.x > 1 || dist.y > 1) MakePlrPath(pnum, monster[p->wParam1].position.future, false); plr[pnum].destAction = ACTION_ATTACKMON; plr[pnum].destParam1 = p->wParam1;