aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-17 18:07:09 -0600
committermegamage <none@none>2009-02-17 18:07:09 -0600
commit05ef0471c32aecbc10708acfc851185d15f64636 (patch)
tree0855cd7adc2d2575729b3478174ac88a4ce6ac00
parent1f183d9e80468ed9cc1b679c5fa7fd182cf12300 (diff)
*Fix a crash bug caused by bindsight spells.
--HG-- branch : trunk
-rw-r--r--src/game/Player.cpp8
-rw-r--r--src/game/Player.h1
-rw-r--r--src/game/SpellAuras.cpp5
3 files changed, 4 insertions, 10 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 3bb7c959ca0..20abcc3ec02 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 aadee62f52f..8e34ca7e9cd 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 d411ea7343d..011ce5b743e 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)