From eb9328e4dbd5e136728f90ae794da1066688953f Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 30 Apr 2009 16:13:57 -0500 Subject: *Fix the calculation of isInLine. --HG-- branch : trunk --- src/game/Object.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/game/Object.cpp') diff --git a/src/game/Object.cpp b/src/game/Object.cpp index e7d07422c7a..fe3239e9d6b 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1153,6 +1153,13 @@ float WorldObject::GetDistance2d(float x, float y) const return ( dist > 0 ? dist : 0); } +float WorldObject::GetExactDistance2d(const float x, const float y) const +{ + float dx = GetPositionX() - x; + float dy = GetPositionY() - y; + return sqrt((dx*dx) + (dy*dy)); +} + float WorldObject::GetDistance(const float x, const float y, const float z) const { float dx = GetPositionX() - x; -- cgit v1.2.3