From 39bbf078661471acc0b77a2f60090ea379bb42ce Mon Sep 17 00:00:00 2001 From: Vladimir Olteanu Date: Wed, 2 Jun 2021 10:40:05 +0300 Subject: [PATCH] Use WalkingDistance for GetMinDistance --- Source/controls/plrctrls.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/controls/plrctrls.cpp b/Source/controls/plrctrls.cpp index 736f01164..50b384277 100644 --- a/Source/controls/plrctrls.cpp +++ b/Source/controls/plrctrls.cpp @@ -75,10 +75,7 @@ int GetRotaryDistance(int x, int y) */ int GetMinDistance(Point position) { - auto &myPlayer = plr[myplr]; - Point delta = abs(myPlayer.position.future - position); - - return std::max(delta.x, delta.y); + return plr[myplr].position.future.WalkingDistance(position); } /**