aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/pink/objects/walk/walk_mgr.cpp3
1 files changed, 1 insertions, 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) {