Core/Auras: Move repeating code for aura packet creation to separate function. Fixes usage of SPELL_ATTR5_HIDE_DURATION attribute.

This commit is contained in:
QAston
2011-06-08 10:41:32 +02:00
parent 0575dddbb3
commit 0c3e99c450
3 changed files with 15 additions and 32 deletions
+1 -22
View File
@@ -21710,28 +21710,7 @@ void Player::SendAurasForTarget(Unit *target)
for (Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr)
{
AuraApplication * auraApp = itr->second;
Aura * aura = auraApp->GetBase();
data << uint8(auraApp->GetSlot());
data << uint32(aura->GetId());
// flags
uint32 flags = auraApp->GetFlags();
if (aura->GetMaxDuration() > 0)
flags |= AFLAG_DURATION;
data << uint8(flags);
// level
data << uint8(aura->GetCasterLevel());
// charges
data << uint8(aura->GetStackAmount() > 1 ? aura->GetStackAmount() : (aura->GetCharges()) ? aura->GetCharges() : 1);
if (!(flags & AFLAG_CASTER))
data.appendPackGUID(aura->GetCasterGUID());
if (flags & AFLAG_DURATION) // include aura duration
{
data << uint32(aura->GetMaxDuration());
data << uint32(aura->GetDuration());
}
auraApp->BuildUpdatePacket(data, false);
}
GetSession()->SendPacket(&data);