From 51de9716c1889aacb2c3dfb9b51d43cc9d8a23f0 Mon Sep 17 00:00:00 2001 From: Vladimir Olteanu Date: Wed, 2 Jun 2021 11:18:40 +0300 Subject: [PATCH] Use WalkingDistance in MAI_Zombie --- Source/monster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/monster.cpp b/Source/monster.cpp index 8463c7f1b..6fe96d282 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -2899,7 +2899,7 @@ void MAI_Zombie(int i) } if (GenerateRnd(100) < 2 * Monst->_mint + 10) { - int dist = std::max(abs(mx - Monst->enemyPosition.x), abs(my - Monst->enemyPosition.y)); + int dist = Monst->enemyPosition.WalkingDistance({ mx, my }); if (dist >= 2) { if (dist >= 2 * Monst->_mint + 4) { Direction md = Monst->_mdir;