aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/objects
diff options
context:
space:
mode:
authorAndrei Prykhodko2018-06-27 23:04:53 +0300
committerEugene Sandulenko2018-06-28 23:51:32 +0200
commite25a9cabb40ad877940c866ebfff4ec3983ca352 (patch)
tree688f0300429b1eb189ae73a3fda13d4091c7916e /engines/pink/objects
parent40488c8b22ca5ab5b44881045d20ba271afa78a7 (diff)
downloadscummvm-rg350-e25a9cabb40ad877940c866ebfff4ec3983ca352.tar.gz
scummvm-rg350-e25a9cabb40ad877940c866ebfff4ec3983ca352.tar.bz2
scummvm-rg350-e25a9cabb40ad877940c866ebfff4ec3983ca352.zip
PINK: rework getting length between locations
Diffstat (limited to 'engines/pink/objects')
-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) {