[11343] Check creature*_addon.auras duplicates at loading.

This already checked at apply to creature but startup check more helpful for DB devs.
Also remove use single field structure use for store addon.auras data
This commit is contained in:
VladimirMangos 2011-04-13 15:22:20 +04:00
parent 695ad4d54e
commit 6c8efb4458
4 changed files with 20 additions and 20 deletions

View file

@ -1943,19 +1943,19 @@ bool Creature::LoadCreatureAddon(bool reload)
if(cainfo->auras)
{
for (CreatureDataAddonAura const* cAura = cainfo->auras; cAura->spell_id; ++cAura)
for (uint32 const* cAura = cainfo->auras; *cAura; ++cAura)
{
SpellEntry const *AdditionalSpellInfo = sSpellStore.LookupEntry(cAura->spell_id);
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->spell_id);
sLog.outErrorDb("Creature (GUIDLow: %u Entry: %u ) has wrong spell %u defined in `auras` field.",GetGUIDLow(),GetEntry(), *cAura);
continue;
}
if (HasAura(cAura->spell_id))
if (HasAura(*cAura))
{
if(!reload)
sLog.outErrorDb("Creature (GUIDLow: %u Entry: %u) has duplicate spell %u in `auras` field.", GetGUIDLow(), GetEntry(), cAura->spell_id);
if (!reload)
sLog.outErrorDb("Creature (GUIDLow: %u Entry: %u) has duplicate spell %u in `auras` field.", GetGUIDLow(), GetEntry(), *cAura);
continue;
}