mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +00:00
[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:
parent
98ae9efbc6
commit
1377db20a7
2 changed files with 42 additions and 42 deletions
|
|
@ -19752,59 +19752,59 @@ void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value )
|
||||||
|
|
||||||
void Player::SendAurasForTarget(Unit *target)
|
void Player::SendAurasForTarget(Unit *target)
|
||||||
{
|
{
|
||||||
if(target->GetVisibleAuras()->empty()) // speedup things
|
|
||||||
return;
|
|
||||||
|
|
||||||
WorldPacket data(SMSG_AURA_UPDATE_ALL);
|
WorldPacket data(SMSG_AURA_UPDATE_ALL);
|
||||||
data << target->GetPackGUID();
|
data << target->GetPackGUID();
|
||||||
|
|
||||||
Unit::VisibleAuraMap const *visibleAuras = target->GetVisibleAuras();
|
if(!target->GetVisibleAuras()->empty()) // speedup things
|
||||||
for(Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr)
|
|
||||||
{
|
{
|
||||||
SpellAuraHolderBounds bounds = target->GetSpellAuraHolderBounds(itr->second);
|
Unit::VisibleAuraMap const *visibleAuras = target->GetVisibleAuras();
|
||||||
for (SpellAuraHolderMap::const_iterator iter = bounds.first; iter != bounds.second; ++iter)
|
for(Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr)
|
||||||
{
|
{
|
||||||
SpellAuraHolder *holder = iter->second;
|
SpellAuraHolderBounds bounds = target->GetSpellAuraHolderBounds(itr->second);
|
||||||
data << uint8(holder->GetAuraSlot());
|
for (SpellAuraHolderMap::const_iterator iter = bounds.first; iter != bounds.second; ++iter)
|
||||||
data << uint32(holder->GetId());
|
|
||||||
|
|
||||||
if(holder->GetId())
|
|
||||||
{
|
{
|
||||||
uint8 auraFlags = holder->GetAuraFlags();
|
SpellAuraHolder *holder = iter->second;
|
||||||
// flags
|
data << uint8(holder->GetAuraSlot());
|
||||||
data << uint8(auraFlags);
|
data << uint32(holder->GetId());
|
||||||
// level
|
|
||||||
data << uint8(holder->GetAuraLevel());
|
|
||||||
// charges
|
|
||||||
if (holder->GetAuraCharges())
|
|
||||||
data << uint8(holder->GetAuraCharges() * holder->GetStackAmount());
|
|
||||||
else
|
|
||||||
data << uint8(holder->GetStackAmount());
|
|
||||||
|
|
||||||
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
|
if(!(auraFlags & AFLAG_NOT_CASTER)) // packed GUID of caster
|
||||||
{
|
|
||||||
// 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)))
|
data.appendPackGUID(holder->GetCasterGUID());
|
||||||
{
|
|
||||||
if (uint32(aura->GetAuraMaxDuration()) > max_duration)
|
|
||||||
{
|
|
||||||
max_duration = aura->GetAuraMaxDuration();
|
|
||||||
duration = aura->GetAuraDuration();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data << uint32(max_duration);
|
if(auraFlags & AFLAG_DURATION) // include aura duration
|
||||||
data << uint32(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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10220"
|
#define REVISION_NR "10221"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue