From 231cb0f5a7707017cd37628c389c32e42f24f1fe Mon Sep 17 00:00:00 2001 From: QAston Date: Sat, 27 Dec 2008 22:24:29 +0100 Subject: *Remove aura slot from update fields at aura remove. --HG-- branch : trunk --- src/game/Unit.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 8e81c11582b..b726e78c69e 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -12286,7 +12286,7 @@ uint32 Unit::GetCastingTimeForBonus( SpellEntry const *spellProto, DamageEffectT return CastingTime; } -void Unit::UpdateAuraForGroup(uint8 slot) +void Unit::UpdateAuraForGroup(uint8 slot, bool apply) { if(GetTypeId() == TYPEID_PLAYER) { @@ -12294,7 +12294,10 @@ void Unit::UpdateAuraForGroup(uint8 slot) if(player->GetGroup()) { player->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_AURAS); - player->SetAuraUpdateMask(slot); + if(apply) + player->SetAuraUpdateMask(slot); + else + player->UnsetAuraUpdateMask(slot); } } else if(GetTypeId() == TYPEID_UNIT && ((Creature*)this)->isPet()) @@ -12306,7 +12309,10 @@ void Unit::UpdateAuraForGroup(uint8 slot) if(owner && (owner->GetTypeId() == TYPEID_PLAYER) && ((Player*)owner)->GetGroup()) { ((Player*)owner)->SetGroupUpdateFlag(GROUP_UPDATE_FLAG_PET_AURAS); - pet->SetAuraUpdateMask(slot); + if(apply) + pet->SetAuraUpdateMask(slot); + else + pet->UnsetAuraUpdateMask(slot); } } } -- cgit v1.2.3 From f650b55c2300870f0a7fa0d3d24a0c7d30aaaf31 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 28 Dec 2008 10:00:27 -0600 Subject: *Fix the bug that ~Unit makes crash. --HG-- branch : trunk --- src/game/Unit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b726e78c69e..1fed4717db6 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -11095,6 +11095,8 @@ void Unit::CleanupsBeforeDelete() { if(m_uint32Values) // only for fully created object { + UnpossessSelf(false); + RemoveAllFromVision(); InterruptNonMeleeSpells(true); m_Events.KillAllEvents(false); // non-delatable (currently casted spells) will not deleted now but it will deleted at call in Map::RemoveAllObjectsInRemoveList CombatStop(); @@ -11104,8 +11106,6 @@ void Unit::CleanupsBeforeDelete() RemoveAllAuras(); RemoveAllGameObjects(); RemoveAllDynObjects(); - UnpossessSelf(false); - RemoveAllFromVision(); GetMotionMaster()->Clear(false); // remove different non-standard movement generators. } RemoveFromWorld(); -- cgit v1.2.3