Refactor pet cast handler.
Closes https://github.com/vmangos/core/issues/1277
This commit is contained in:
@@ -1827,24 +1827,9 @@ bool WorldObject::HasInArc(WorldObject const* target, float const arcangle, floa
|
||||
return ((angle >= lborder) && (angle <= rborder));
|
||||
}
|
||||
|
||||
bool WorldObject::isInFrontInMap(WorldObject const* target, float distance, float arc) const
|
||||
bool WorldObject::IsFacingTarget(WorldObject const* target) const
|
||||
{
|
||||
return IsWithinDistInMap(target, distance) && HasInArc(target, arc);
|
||||
}
|
||||
|
||||
bool WorldObject::isInBackInMap(WorldObject const* target, float distance, float arc) const
|
||||
{
|
||||
return IsWithinDistInMap(target, distance) && !HasInArc(target, 2 * M_PI_F - arc);
|
||||
}
|
||||
|
||||
bool WorldObject::isInFront(WorldObject const* target, float distance, float arc) const
|
||||
{
|
||||
return IsWithinDist(target, distance) && HasInArc(target, arc);
|
||||
}
|
||||
|
||||
bool WorldObject::isInBack(WorldObject const* target, float distance, float arc) const
|
||||
{
|
||||
return IsWithinDist(target, distance) && !HasInArc(target, 2 * M_PI_F - arc);
|
||||
return (GetDistance2dToCenter(target) < NO_FACING_CHECKS_DISTANCE) || HasInArc(target);
|
||||
}
|
||||
|
||||
bool WorldObject::GetRandomPoint(float x, float y, float z, float distance, float &rand_x, float &rand_y, float &rand_z) const
|
||||
|
||||
Reference in New Issue
Block a user