diff options
-rw-r--r-- | engines/fullpipe/motion.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp index baea2e28bd..47cf52417b 100644 --- a/engines/fullpipe/motion.cpp +++ b/engines/fullpipe/motion.cpp @@ -1289,11 +1289,11 @@ double MovGraph::calcDistance(Common::Point *point, MovGraphLink *link, int fuzz int n2x = link->_graphDst->_x; int n2y = link->_graphDst->_y; double dist1x = (double)(point->x - n1x); - double dist1y = (double)(n1y - point->y); + double dist1y = (double)(point->y - n1y); double dist2x = (double)(n2x - n1x); double dist2y = (double)(n2y - n1y); - double dist1 = sqrt(dist1y * dist1y + dist1x * dist1x); - double dist2 = ((double)(n1y - n2y) * dist1y + dist2x * dist1x) / link->_length / dist1; + double dist1 = sqrt(dist1x * dist1x + dist1y * dist1y); + double dist2 = (dist2y * dist1y + dist2x * dist1x) / link->_length / dist1; double distm = dist2 * dist1; double res = sqrt(1.0 - dist2 * dist2) * dist1; |