From 05ef0471c32aecbc10708acfc851185d15f64636 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 17 Feb 2009 18:07:09 -0600 Subject: [PATCH] *Fix a crash bug caused by bindsight spells. --HG-- branch : trunk --- src/game/Player.cpp | 8 -------- src/game/Player.h | 1 - src/game/SpellAuras.cpp | 5 ++++- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 3bb7c959ca..20abcc3ec0 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -19874,14 +19874,6 @@ void Player::HandleFallUnderMap() sLog.outDetail("Viewport for "I64FMT" (%s) changed to "I64FMT, GetGUID(), GetName(), guid); }*/ -void Player::SetBindSight(Unit *target) -{ - if(target) - target->AddPlayerToVision(this); - else - target->RemovePlayerFromVision(this); -} - WorldObject* Player::GetFarsightTarget() const { // Players can have in farsight field another player's guid, a creature's guid, or a dynamic object's guid diff --git a/src/game/Player.h b/src/game/Player.h index aadee62f52..8e34ca7e9c 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2027,7 +2027,6 @@ class TRINITY_DLL_SPEC Player : public Unit void StopCastingBindSight(); uint64 GetFarSightGUID() const { return GetUInt64Value(PLAYER_FARSIGHT); } void SetFarSightGUID(uint64 guid) { SetUInt64Value(PLAYER_FARSIGHT, guid); } - void SetBindSight(Unit *target); WorldObject* GetFarsightTarget() const; void ClearFarsight(); void SetFarsightTarget(WorldObject* target); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index d411ea7343..011ce5b743 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2832,7 +2832,10 @@ void Aura::HandleBindSight(bool apply, bool Real) if(!caster || caster->GetTypeId() != TYPEID_PLAYER) return; - ((Player*)caster)->SetBindSight(apply ? m_target : NULL); + if(apply) + m_target->AddPlayerToVision((Player*)caster); + else + m_target->RemovePlayerFromVision((Player*)caster); } void Aura::HandleFarSight(bool apply, bool Real)