From e25a9cabb40ad877940c866ebfff4ec3983ca352 Mon Sep 17 00:00:00 2001 From: Andrei Prykhodko Date: Wed, 27 Jun 2018 23:04:53 +0300 Subject: PINK: rework getting length between locations --- engines/pink/objects/walk/walk_mgr.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/engines/pink/objects/walk/walk_mgr.cpp b/engines/pink/objects/walk/walk_mgr.cpp index 3343af0090..6bda000eb8 100644 --- a/engines/pink/objects/walk/walk_mgr.cpp +++ b/engines/pink/objects/walk/walk_mgr.cpp @@ -108,8 +108,7 @@ WalkAction *WalkMgr::getWalkAction() { double WalkMgr::getLengthBetweenLocations(WalkLocation *first, WalkLocation *second) { Coordinates firstCoord = getLocationCoordinates(first->getName()); Coordinates secondCoord = getLocationCoordinates(second->getName()); - return (double)sqrt((double)(secondCoord.point.x - firstCoord.point.x) * (secondCoord.point.x - firstCoord.point.x) + - (secondCoord.point.y - firstCoord.point.y) * (secondCoord.point.y - firstCoord.point.y)); + return hypot(secondCoord.point.x - firstCoord.point.x, secondCoord.point.y - firstCoord.point.y); } Coordinates WalkMgr::getLocationCoordinates(const Common::String &locationName) { -- cgit v1.2.3