Allow spellid_x fields in item_template to be -1
--HG-- branch : trunk
This commit is contained in:
@@ -2172,12 +2172,12 @@ void ObjectMgr::LoadItemPrototypes()
|
|||||||
const_cast<ItemPrototype*>(proto)->Spells[0].SpellId = 0;
|
const_cast<ItemPrototype*>(proto)->Spells[0].SpellId = 0;
|
||||||
const_cast<ItemPrototype*>(proto)->Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
|
const_cast<ItemPrototype*>(proto)->Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
|
||||||
}
|
}
|
||||||
else
|
else if (proto->Spells[1].SpellId != -1)
|
||||||
{
|
{
|
||||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[1].SpellId);
|
SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[1].SpellId);
|
||||||
if (!spellInfo)
|
if (!spellInfo)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%u)",i,1+1,proto->Spells[1].SpellId);
|
sLog.outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)",i,1+1,proto->Spells[1].SpellId);
|
||||||
const_cast<ItemPrototype*>(proto)->Spells[0].SpellId = 0;
|
const_cast<ItemPrototype*>(proto)->Spells[0].SpellId = 0;
|
||||||
const_cast<ItemPrototype*>(proto)->Spells[1].SpellId = 0;
|
const_cast<ItemPrototype*>(proto)->Spells[1].SpellId = 0;
|
||||||
const_cast<ItemPrototype*>(proto)->Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
|
const_cast<ItemPrototype*>(proto)->Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
|
||||||
@@ -2185,7 +2185,7 @@ void ObjectMgr::LoadItemPrototypes()
|
|||||||
// allowed only in special format
|
// allowed only in special format
|
||||||
else if ((proto->Spells[1].SpellId == 483) || (proto->Spells[1].SpellId == 55884))
|
else if ((proto->Spells[1].SpellId == 483) || (proto->Spells[1].SpellId == 55884))
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%u)",i,1+1,proto->Spells[1].SpellId);
|
sLog.outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)",i,1+1,proto->Spells[1].SpellId);
|
||||||
const_cast<ItemPrototype*>(proto)->Spells[0].SpellId = 0;
|
const_cast<ItemPrototype*>(proto)->Spells[0].SpellId = 0;
|
||||||
const_cast<ItemPrototype*>(proto)->Spells[1].SpellId = 0;
|
const_cast<ItemPrototype*>(proto)->Spells[1].SpellId = 0;
|
||||||
const_cast<ItemPrototype*>(proto)->Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
|
const_cast<ItemPrototype*>(proto)->Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
|
||||||
@@ -2203,7 +2203,7 @@ void ObjectMgr::LoadItemPrototypes()
|
|||||||
}
|
}
|
||||||
else if (proto->Spells[j].SpellId != 0)
|
else if (proto->Spells[j].SpellId != 0)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Item (Entry: %u) has wrong spell in spellid_%d (%u) for learning special format",i,j+1,proto->Spells[j].SpellId);
|
sLog.outErrorDb("Item (Entry: %u) has wrong spell in spellid_%d (%d) for learning special format",i,j+1,proto->Spells[j].SpellId);
|
||||||
const_cast<ItemPrototype*>(proto)->Spells[j].SpellId = 0;
|
const_cast<ItemPrototype*>(proto)->Spells[j].SpellId = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2220,18 +2220,18 @@ void ObjectMgr::LoadItemPrototypes()
|
|||||||
const_cast<ItemPrototype*>(proto)->Spells[j].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
|
const_cast<ItemPrototype*>(proto)->Spells[j].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (proto->Spells[j].SpellId)
|
if (proto->Spells[j].SpellId && proto->Spells[j].SpellId != -1)
|
||||||
{
|
{
|
||||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[j].SpellId);
|
SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[j].SpellId);
|
||||||
if (!spellInfo)
|
if (!spellInfo)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%u)",i,j+1,proto->Spells[j].SpellId);
|
sLog.outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)",i,j+1,proto->Spells[j].SpellId);
|
||||||
const_cast<ItemPrototype*>(proto)->Spells[j].SpellId = 0;
|
const_cast<ItemPrototype*>(proto)->Spells[j].SpellId = 0;
|
||||||
}
|
}
|
||||||
// allowed only in special format
|
// allowed only in special format
|
||||||
else if ((proto->Spells[j].SpellId == 483) || (proto->Spells[j].SpellId == 55884))
|
else if ((proto->Spells[j].SpellId == 483) || (proto->Spells[j].SpellId == 55884))
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%u)",i,j+1,proto->Spells[j].SpellId);
|
sLog.outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)",i,j+1,proto->Spells[j].SpellId);
|
||||||
const_cast<ItemPrototype*>(proto)->Spells[j].SpellId = 0;
|
const_cast<ItemPrototype*>(proto)->Spells[j].SpellId = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user