*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
+10 -7
View File
@@ -15841,17 +15841,20 @@ void Player::_SaveAuras()
AuraMap const& auras = GetAuras();
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.
// do not save single target auras (unless they were cast by the player)
// skip:
// area auras or single cast auras casted by other unit
// passive auras and stances
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())
continue;
SpellEntry const *spellInfo = itr->second->GetSpellProto();
for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
if (spellInfo->Effect[i] == SPELL_AURA_MOD_SHAPESHIFT ||
spellInfo->Effect[i] == SPELL_AURA_MOD_STEALTH )
bool isCaster = itr->second->GetCasterGUID() == GetGUID();
if (!isCaster)
if (itr->second->IsSingleTarget()
|| itr->second->IsAreaAura())
continue;
int32 amounts[MAX_SPELL_EFFECTS];
for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
{