diff options
author | n0n4m3 <none@none> | 2009-12-17 19:09:40 +0100 |
---|---|---|
committer | n0n4m3 <none@none> | 2009-12-17 19:09:40 +0100 |
commit | 3e133c47865d57816132300df2749b297f97bce0 (patch) | |
tree | 306c46fe0dd82f3909f65ef3cfccd3426bc049da /src/game/Object.cpp | |
parent | 6b405c63cc291f979abbb8939dd3b129fa664584 (diff) |
[9012] fix crash when achievement is completed and player isn't in world
--HG--
branch : trunk
Diffstat (limited to 'src/game/Object.cpp')
-rw-r--r-- | src/game/Object.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 3e619104272..f3cff243e93 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -1398,6 +1398,16 @@ bool WorldObject::IsInBetween(const WorldObject *obj1, const WorldObject *obj2, return abs(sin(angle)) * GetExactDist2d(obj1->GetPositionX(), obj1->GetPositionY()) < size; } +bool WorldObject::isInFront(WorldObject const* target, float distance, float arc) const +{ + return IsWithinDist(target, distance) && HasInArc( arc, target ); +} + +bool WorldObject::isInBack(WorldObject const* target, float distance, float arc) const +{ + return IsWithinDist(target, distance) && !HasInArc( 2 * M_PI - arc, target ); +} + void WorldObject::GetRandomPoint(const Position &pos, float distance, float &rand_x, float &rand_y, float &rand_z) const { if(!distance) |