Core/Spells: Some corrections after 65aca2b806, this should fix the console spam
This commit is contained in:
@@ -1672,6 +1672,9 @@ bool WorldObject::canSeeOrDetect(WorldObject const* obj, bool ignoreStealth, boo
|
||||
if (Player const* player = this->ToPlayer())
|
||||
viewpoint = player->GetViewpoint();
|
||||
|
||||
if (!viewpoint)
|
||||
viewpoint = this;
|
||||
|
||||
if (!corpseCheck && !viewpoint->IsWithinDist(obj, GetSightRange(obj), false))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -22973,11 +22973,8 @@ void Player::SetViewpoint(WorldObject* target, bool apply)
|
||||
WorldObject* Player::GetViewpoint() const
|
||||
{
|
||||
if (uint64 guid = GetUInt64Value(PLAYER_FARSIGHT))
|
||||
{
|
||||
WorldObject* viewpoint = (WorldObject*) ObjectAccessor::GetObjectByTypeMask(*this, guid, TYPEMASK_SEER);
|
||||
return viewpoint ? viewpoint : (WorldObject*) this; // always expected not NULL
|
||||
}
|
||||
return (WorldObject*) this;
|
||||
return (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*this, guid, TYPEMASK_SEER);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool Player::CanUseBattlegroundObject()
|
||||
|
||||
Reference in New Issue
Block a user