[10221] Fixed visual bug that some deleted auras still show at client side

(based on commit b10058e)

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
SilverIce 2010-07-19 00:08:35 +04:00 committed by VladimirMangos
parent 98ae9efbc6
commit 1377db20a7
2 changed files with 42 additions and 42 deletions

View file

@ -19752,59 +19752,59 @@ void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value )
void Player::SendAurasForTarget(Unit *target)
{
if(target->GetVisibleAuras()->empty()) // speedup things
return;
WorldPacket data(SMSG_AURA_UPDATE_ALL);
data << target->GetPackGUID();
Unit::VisibleAuraMap const *visibleAuras = target->GetVisibleAuras();
for(Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr)
if(!target->GetVisibleAuras()->empty()) // speedup things
{
SpellAuraHolderBounds bounds = target->GetSpellAuraHolderBounds(itr->second);
for (SpellAuraHolderMap::const_iterator iter = bounds.first; iter != bounds.second; ++iter)
Unit::VisibleAuraMap const *visibleAuras = target->GetVisibleAuras();
for(Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr)
{
SpellAuraHolder *holder = iter->second;
data << uint8(holder->GetAuraSlot());
data << uint32(holder->GetId());
if(holder->GetId())
SpellAuraHolderBounds bounds = target->GetSpellAuraHolderBounds(itr->second);
for (SpellAuraHolderMap::const_iterator iter = bounds.first; iter != bounds.second; ++iter)
{
uint8 auraFlags = holder->GetAuraFlags();
// flags
data << uint8(auraFlags);
// level
data << uint8(holder->GetAuraLevel());
// charges
if (holder->GetAuraCharges())
data << uint8(holder->GetAuraCharges() * holder->GetStackAmount());
else
data << uint8(holder->GetStackAmount());
SpellAuraHolder *holder = iter->second;
data << uint8(holder->GetAuraSlot());
data << uint32(holder->GetId());
if(!(auraFlags & AFLAG_NOT_CASTER)) // packed GUID of caster
if(holder->GetId())
{
data.appendPackGUID(holder->GetCasterGUID());
}
uint8 auraFlags = holder->GetAuraFlags();
// flags
data << uint8(auraFlags);
// level
data << uint8(holder->GetAuraLevel());
// charges
if (holder->GetAuraCharges())
data << uint8(holder->GetAuraCharges() * holder->GetStackAmount());
else
data << uint8(holder->GetStackAmount());
if(auraFlags & AFLAG_DURATION) // include aura duration
{
// take highest - to display icon even if stun fades
uint32 max_duration = 0;
uint32 duration = 0;
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
if(!(auraFlags & AFLAG_NOT_CASTER)) // packed GUID of caster
{
if (Aura *aura = holder->GetAuraByEffectIndex(SpellEffectIndex(i)))
{
if (uint32(aura->GetAuraMaxDuration()) > max_duration)
{
max_duration = aura->GetAuraMaxDuration();
duration = aura->GetAuraDuration();
}
}
data.appendPackGUID(holder->GetCasterGUID());
}
data << uint32(max_duration);
data << uint32(duration);
if(auraFlags & AFLAG_DURATION) // include aura duration
{
// take highest - to display icon even if stun fades
uint32 max_duration = 0;
uint32 duration = 0;
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
{
if (Aura *aura = holder->GetAuraByEffectIndex(SpellEffectIndex(i)))
{
if (uint32(aura->GetAuraMaxDuration()) > max_duration)
{
max_duration = aura->GetAuraMaxDuration();
duration = aura->GetAuraDuration();
}
}
}
data << uint32(max_duration);
data << uint32(duration);
}
}
}
}