diff options
| author | megamage <none@none> | 2009-02-17 21:50:18 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2009-02-17 21:50:18 -0600 |
| commit | be53cfe1044d7e913c4c11a7245e2d2846826363 (patch) | |
| tree | 01d9eed43ebf99bd2829827fdc9d966c4992fd3b /src/game/Unit.cpp | |
| parent | d11c80ec54bff97235440ff50c44edd420e777f9 (diff) | |
*Fix some bugs of map/grid. Hope this can fix some crashes (without introducing new crash)
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
| -rw-r--r-- | src/game/Unit.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index cc6d1f7aa94..40d051fa19a 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4830,7 +4830,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); } @@ -8473,20 +8473,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); @@ -11132,6 +11123,8 @@ void Unit::RemoveFromWorld() // cleanup if(IsInWorld()) { + RemoveCharmAuras(); + RemoveBindSightAuras(); RemoveNotOwnSingleTargetAuras(); } |
