*Try to fix a crash caused by single target auras. Thanks to QAston.

--HG--
branch : trunk
This commit is contained in:
megamage committed 2009-08-11 18:26:04 -05:00
1 parent 3078bf6fd0
commit 978242da3f
5 files changed
+28 -21

No files matched your search

+6 -9
View File
@@ -15195,6 +15195,11 @@ void Player::_LoadAuras(QueryResult *result, uint32 timediff)
Aura* aura = new Aura(spellproto, effmask, NULL, this, NULL, NULL);
aura->SetLoadedState(caster_guid,maxduration,remaintime,remaincharges, stackcount, &damage[0]);
if(!aura->CanBeSaved())
{
delete aura;
continue;
}
AddAura(aura);
sLog.outDetail("Added aura spellid %u, effectmask %u", spellproto->Id, effmask);
}
@@ -16275,17 +16280,9 @@ void Player::_SaveAuras()
AuraMap const& auras = GetAuras();
for(AuraMap::const_iterator itr = auras.begin(); itr !=auras.end() ; ++itr)
{
// skip:
// area auras or single cast auras casted by other unit
// passive auras and stances
if (itr->second->IsPassive())
if(!itr->second->CanBeSaved())
continue;
if (itr->second->GetCasterGUID() != GetGUID())
if (IsSingleTargetSpell(itr->second->GetSpellProto())
|| itr->second->IsAreaAura())
continue;
int32 amounts[MAX_SPELL_EFFECTS];
for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
{