aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-28 10:52:24 -0600
committermegamage <none@none>2008-12-28 10:52:24 -0600
commit3bbf8d6be8cd67d99fc8c1df3a971fe4e7e680ef (patch)
tree0264a08b586df36f290a6b1b6a839dcf9b829c75 /src/game/Unit.cpp
parentac9cced914fb4c9db0b2b64f7fd9f9ab8c7802ee (diff)
parent9fa37dc69344a28a585bc2dee6713d7ebaa03d28 (diff)
HG 698.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 56a63cc5220..5a2503f99fe 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -11199,6 +11199,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();
@@ -11208,8 +11210,6 @@ void Unit::CleanupsBeforeDelete()
RemoveAllAuras();
RemoveAllGameObjects();
RemoveAllDynObjects();
- UnpossessSelf(false);
- RemoveAllFromVision();
GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
}
RemoveFromWorld();
@@ -12400,7 +12400,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)
{
@@ -12408,7 +12408,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())
@@ -12420,7 +12423,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);
}
}
}