Better way to check for RandomProperty == -1, assign 0 to it for now.

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-06-27 19:46:25 +02:00
parent cd47c87a7c
commit 0b063e189b
2 changed files with 13 additions and 11 deletions
+10 -3
View File
@@ -2256,10 +2256,17 @@ void ObjectMgr::LoadItemPrototypes()
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);
const_cast<ItemPrototype*>(proto)->RandomProperty = 0;
// To be implemented later
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)))