Merge pull request #4591 from elecyb/farsight
Core/Spells: Update nearby visible objects for new viewpoints
This commit is contained in:
@@ -1668,7 +1668,11 @@ bool WorldObject::canSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
||||
}
|
||||
}
|
||||
|
||||
if (!corpseCheck && !IsWithinDist(obj, GetSightRange(obj), false))
|
||||
WorldObject const* viewpoint = this;
|
||||
if (Player const* player = this->ToPlayer())
|
||||
viewpoint = player->GetViewpoint();
|
||||
|
||||
if (!corpseCheck && !viewpoint->IsWithinDist(obj, GetSightRange(obj), false))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -22973,8 +22973,11 @@ void Player::SetViewpoint(WorldObject* target, bool apply)
|
||||
WorldObject* Player::GetViewpoint() const
|
||||
{
|
||||
if (uint64 guid = GetUInt64Value(PLAYER_FARSIGHT))
|
||||
return (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*this, guid, TYPEMASK_SEER);
|
||||
return NULL;
|
||||
{
|
||||
WorldObject* viewpoint = (WorldObject*) ObjectAccessor::GetObjectByTypeMask(*this, guid, TYPEMASK_SEER);
|
||||
return viewpoint ? viewpoint : (WorldObject*) this; // always expected not NULL
|
||||
}
|
||||
return (WorldObject*) this;
|
||||
}
|
||||
|
||||
bool Player::CanUseBattlegroundObject()
|
||||
|
||||
Reference in New Issue
Block a user