From 76269b95ee5651794fc2cf7b1b5b5fbf8d69dd7a Mon Sep 17 00:00:00 2001 From: Vladimir Olteanu Date: Wed, 2 Jun 2021 10:46:45 +0300 Subject: [PATCH] Use WalkingDistance in sync_monster --- Source/sync.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/sync.cpp b/Source/sync.cpp index 7ef5f085e..268b08a92 100644 --- a/Source/sync.cpp +++ b/Source/sync.cpp @@ -222,8 +222,7 @@ static void sync_monster(int pnum, const TSyncMonster *p) return; } - Point md = abs(monster[ndx].position.tile - Point { p->_mx, p->_my }); - if (md.x <= 2 && md.y <= 2) { + if (monster[ndx].position.tile.WalkingDistance({ p->_mx, p->_my }) <= 2) { if (monster[ndx]._mmode < MM_WALK || monster[ndx]._mmode > MM_WALK3) { Direction md = GetDirection(monster[ndx].position.tile, { p->_mx, p->_my }); if (DirOK(ndx, md)) {