aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-26 10:53:19 -0600
committermegamage <none@none>2009-03-26 10:53:19 -0600
commitbdafaf41134a26818d81ad1ffe853f6013635c4c (patch)
tree7a6664075e8f9c710d5209e011983e19c983cbbf
parent56cf3da6cbf1bc1dfe2d6e9ce1669742556b28bc (diff)
*Remove viewpoint when dynamicobject is removed from world.
--HG-- branch : trunk
-rw-r--r--src/game/DynamicObject.cpp13
-rw-r--r--src/game/SpellAuras.cpp12
2 files changed, 13 insertions, 12 deletions
diff --git a/src/game/DynamicObject.cpp b/src/game/DynamicObject.cpp
index 3ac8b688e8b..72c1f4b2ce2 100644
--- a/src/game/DynamicObject.cpp
+++ b/src/game/DynamicObject.cpp
@@ -53,6 +53,18 @@ void DynamicObject::RemoveFromWorld()
///- Remove the dynamicObject from the accessor
if(IsInWorld())
{
+ if(m_effIndex == 4)
+ {
+ if(Unit *caster = GetCaster())
+ {
+ if(caster->GetTypeId() == TYPEID_PLAYER)
+ ((Player*)caster)->SetViewpoint(this, false);
+ }
+ else
+ {
+ sLog.outCrash("DynamicObject::RemoveFromWorld cannot find viewpoint owner");
+ }
+ }
ObjectAccessor::Instance().RemoveObject(this);
WorldObject::RemoveFromWorld();
}
@@ -134,6 +146,7 @@ void DynamicObject::Update(uint32 p_time)
void DynamicObject::Delete()
{
SendObjectDeSpawnAnim(GetGUID());
+ RemoveFromWorld();
AddObjectToRemoveList();
}
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index f939e4bc481..0ed5998ba7f 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -2049,18 +2049,6 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
// AT REMOVE
else
{
- if(GetSpellProto()->Effect[0]==72 )
- {
- // spells with SpellEffect=72 and aura=4: 6196, 6197, 21171, 21425
- if(DynamicObject* dynObj = m_target->GetDynObject(GetId(), 0))
- {
- if(m_target->GetTypeId() == TYPEID_PLAYER)
- ((Player*)m_target)->SetViewpoint(dynObj, false);
- m_target->RemoveDynObject(GetId());
- }
- return;
- }
-
if( (IsQuestTameSpell(GetId())) && caster && caster->isAlive() && m_target->isAlive())
{
uint32 finalSpelId = 0;