[11817] Improve db error log output for *_addon auras

This clearifies that a problem is caused by already applied auras and not double aura in *_addon table.
The double spell entry as well as the invalid spell are filtered on load.

Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
Schmoozerd 2011-10-11 17:51:06 +02:00
parent 5880014d93
commit 9c70637333
2 changed files with 4 additions and 11 deletions

View file

@ -1955,26 +1955,19 @@ bool Creature::LoadCreatureAddon(bool reload)
if (cainfo->splineFlags & SPLINEFLAG_FLYING)
SetLevitate(true);
if(cainfo->auras)
if (cainfo->auras)
{
for (uint32 const* cAura = cainfo->auras; *cAura; ++cAura)
{
SpellEntry const *AdditionalSpellInfo = sSpellStore.LookupEntry(*cAura);
if (!AdditionalSpellInfo)
{
sLog.outErrorDb("Creature (GUIDLow: %u Entry: %u ) has wrong spell %u defined in `auras` field.",GetGUIDLow(),GetEntry(), *cAura);
continue;
}
if (HasAura(*cAura))
{
if (!reload)
sLog.outErrorDb("Creature (GUIDLow: %u Entry: %u) has duplicate spell %u in `auras` field.", GetGUIDLow(), GetEntry(), *cAura);
sLog.outErrorDb("Creature (GUIDLow: %u Entry: %u) has spell %u in `auras` field, but aura is already applied.", GetGUIDLow(), GetEntry(), *cAura);
continue;
}
CastSpell(this, AdditionalSpellInfo, true);
CastSpell(this, *cAura, true);
}
}
return true;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11816"
#define REVISION_NR "11817"
#endif // __REVISION_NR_H__