mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-10 20:01:25 +00:00
PINK: rework getting length between locations
This commit is contained in:
parent
40488c8b22
commit
e25a9cabb4
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user