*Save only auras which need to be saved-this also removes error spam for duplicate entries.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-04-08 18:32:48 +02:00
parent d94a23e61a
commit fc7d2a5393
3 changed files with 17 additions and 15 deletions
+6 -7
View File
@@ -1148,15 +1148,14 @@ void Pet::_SaveAuras()
{ {
// skip all auras from spell that apply at cast SPELL_AURA_MOD_SHAPESHIFT or pet area auras. // skip all auras from spell that apply at cast SPELL_AURA_MOD_SHAPESHIFT or pet area auras.
// do not save single target auras (unless they were cast by the player) // do not save single target auras (unless they were cast by the player)
if (itr->second->IsPassive() if (itr->second->IsPassive() || itr->second->IsAuraType(SPELL_AURA_MOD_STEALTH))
|| (itr->second->GetCasterGUID() != GetGUID() && itr->second->IsSingleTarget()))
continue; continue;
SpellEntry const *spellInfo = itr->second->GetSpellProto(); bool isCaster = itr->second->GetCasterGUID() == GetGUID();
for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i) if (!isCaster)
if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_STEALTH || if (itr->second->IsSingleTarget()
spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_OWNER || || itr->second->IsAreaAura())
spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_PET )
continue; continue;
uint32 amounts[MAX_SPELL_EFFECTS]; uint32 amounts[MAX_SPELL_EFFECTS];
for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i) for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
{ {
+10 -7
View File
@@ -15841,17 +15841,20 @@ void Player::_SaveAuras()
AuraMap const& auras = GetAuras(); AuraMap const& auras = GetAuras();
for(AuraMap::const_iterator itr = auras.begin(); itr !=auras.end() ; ++itr) for(AuraMap::const_iterator itr = auras.begin(); itr !=auras.end() ; ++itr)
{ {
// skip all auras from spell that apply at cast SPELL_AURA_MOD_SHAPESHIFT or pet area auras. // skip:
// do not save single target auras (unless they were cast by the player) // area auras or single cast auras casted by other unit
// passive auras and stances
if (itr->second->IsPassive() if (itr->second->IsPassive()
|| (itr->second->GetCasterGUID() != GetGUID() && itr->second->IsSingleTarget()) || itr->second->IsAuraType(SPELL_AURA_MOD_SHAPESHIFT)
|| itr->second->IsAuraType(SPELL_AURA_MOD_STEALTH)
|| itr->second->IsRemovedOnShapeLost()) || itr->second->IsRemovedOnShapeLost())
continue; continue;
SpellEntry const *spellInfo = itr->second->GetSpellProto(); bool isCaster = itr->second->GetCasterGUID() == GetGUID();
for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i) if (!isCaster)
if (spellInfo->Effect[i] == SPELL_AURA_MOD_SHAPESHIFT || if (itr->second->IsSingleTarget()
spellInfo->Effect[i] == SPELL_AURA_MOD_STEALTH ) || itr->second->IsAreaAura())
continue; continue;
int32 amounts[MAX_SPELL_EFFECTS]; int32 amounts[MAX_SPELL_EFFECTS];
for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i) for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
{ {
+1 -1
View File
@@ -415,7 +415,7 @@ m_auraSlot(MAX_AURAS), m_auraLevel(1), m_procCharges(0), m_stackAmount(1),m_aura
m_partAuras[i]=CreateAuraEffect(this, i, NULL , caster); m_partAuras[i]=CreateAuraEffect(this, i, NULL , caster);
// correct flags if aura couldn't be created // correct flags if aura couldn't be created
if (!m_partAuras[i]) if (!m_partAuras[i])
m_auraFlags &= uint8(~(uint8(1) << i)); m_auraFlags &= uint8(~(1<< i));
} }
else else
{ {