Better way to check for RandomProperty == -1, assign 0 to it for now.
--HG-- branch : trunk
This commit is contained in:
@@ -91,15 +91,10 @@ uint32 GetItemEnchantMod(int32 entry)
|
|||||||
if (!entry)
|
if (!entry)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
EnchantmentStore::const_iterator tab;
|
|
||||||
|
|
||||||
if (entry == -1)
|
if (entry == -1)
|
||||||
{
|
return 0;
|
||||||
/* To do: Find randomproperty/suffix based on item level. */
|
|
||||||
}
|
|
||||||
else
|
|
||||||
tab = RandomItemEnch.find(entry);
|
|
||||||
|
|
||||||
|
EnchantmentStore::const_iterator tab = RandomItemEnch.find(entry);
|
||||||
if (tab == RandomItemEnch.end())
|
if (tab == RandomItemEnch.end())
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.",entry);
|
sLog.outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.",entry);
|
||||||
|
|||||||
@@ -2256,10 +2256,17 @@ void ObjectMgr::LoadItemPrototypes()
|
|||||||
const_cast<ItemPrototype*>(proto)->Sheath = SHEATHETYPE_NONE;
|
const_cast<ItemPrototype*>(proto)->Sheath = SHEATHETYPE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (proto->RandomProperty > 0 && !sItemRandomPropertiesStore.LookupEntry(GetItemEnchantMod(proto->RandomProperty)))
|
if (proto->RandomProperty)
|
||||||
{
|
{
|
||||||
sLog.outErrorDb("Item (Entry: %u) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty (%u)",i,proto->RandomProperty);
|
// To be implemented later
|
||||||
const_cast<ItemPrototype*>(proto)->RandomProperty = 0;
|
if (proto->RandomProperty == -1)
|
||||||
|
const_cast<ItemPrototype*>(proto)->RandomProperty = 0;
|
||||||
|
|
||||||
|
else if (!sItemRandomPropertiesStore.LookupEntry(GetItemEnchantMod(proto->RandomProperty)))
|
||||||
|
{
|
||||||
|
sLog.outErrorDb("Item (Entry: %u) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty (%u)",i,proto->RandomProperty);
|
||||||
|
const_cast<ItemPrototype*>(proto)->RandomProperty = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (proto->RandomSuffix && !sItemRandomSuffixStore.LookupEntry(GetItemEnchantMod(proto->RandomSuffix)))
|
if (proto->RandomSuffix && !sItemRandomSuffixStore.LookupEntry(GetItemEnchantMod(proto->RandomSuffix)))
|
||||||
|
|||||||
Reference in New Issue
Block a user