Core/Spells: Fixed crash introduced in last commit

This commit is contained in:
elecyb
2012-01-02 22:49:08 -03:00
parent 993c4e748f
commit aea8b2af44
+4 -1
View File
@@ -22973,7 +22973,10 @@ 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);
{
WorldObject* viewpoint = (WorldObject*) ObjectAccessor::GetObjectByTypeMask(*this, guid, TYPEMASK_SEER);
return viewpoint ? viewpoint : (WorldObject*) this; // always expected not NULL
}
return (WorldObject*) this;
}