Core/Spells: Update nearby visible objects for new viewpoints, fix spells with Far Sight and Bind Sight effects.

This commit is contained in:
elecyb
2012-01-02 16:33:14 -03:00
parent ced346076b
commit 993c4e748f
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -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;
}
+1 -1
View File
@@ -22974,7 +22974,7 @@ WorldObject* Player::GetViewpoint() const
{
if (uint64 guid = GetUInt64Value(PLAYER_FARSIGHT))
return (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*this, guid, TYPEMASK_SEER);
return NULL;
return (WorldObject*) this;
}
bool Player::CanUseBattlegroundObject()