aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-02-18 11:36:19 -0600
committermegamage <none@none>2009-02-18 11:36:19 -0600
commit31637d4aac6ae2081ccb3db976cab17936019f1a (patch)
treea0e098d4afafaddcb901486d00da1563ecd628b9 /src/game/Unit.cpp
parent017f309b5b5b981b6edfe0ae071971d513828a20 (diff)
parent7bff1c1d60b78ba78f2ab0a9c67bdde80427ea30 (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index b7a92c98125..0c1910d43ea 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -4305,7 +4305,7 @@ void Unit::RemoveDynObject(uint32 spellid)
for (DynObjectGUIDs::iterator i = m_dynObjGUIDs.begin(); i != m_dynObjGUIDs.end();)
{
DynamicObject* dynObj = ObjectAccessor::GetDynamicObject(*this, *i);
- if(!dynObj)
+ if(!dynObj) // may happen if a dynobj is removed when grid unload
{
i = m_dynObjGUIDs.erase(i);
}
@@ -7670,20 +7670,11 @@ void Unit::RemovePlayerFromVision(Player* plr)
void Unit::RemoveBindSightAuras()
{
- /*while (!m_sharedVision.empty())
- {
- Player* plr = *m_sharedVision.begin();
- m_sharedVision.erase(m_sharedVision.begin());
- plr->ClearFarsight();
- }*/
RemoveSpellsCausingAura(SPELL_AURA_BIND_SIGHT);
}
void Unit::RemoveCharmAuras()
{
- if (!GetCharmer())
- return;
-
RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM);
RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET);
RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS);
@@ -10702,6 +10693,8 @@ void Unit::RemoveFromWorld()
// cleanup
if(IsInWorld())
{
+ RemoveCharmAuras();
+ RemoveBindSightAuras();
RemoveNotOwnSingleTargetAuras();
}