Remove some faulty code for picking a random item enchant if RandomProperty is -1. This will have to be implemented correctly later.

Also prevent the core throwing errors when loading items with RandomProperty -1

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2010-06-27 11:48:33 +02:00
parent 499fa9b7cb
commit 60349c5700
2 changed files with 2 additions and 5 deletions

View File

@@ -95,10 +95,7 @@ uint32 GetItemEnchantMod(int32 entry)
if (entry == -1)
{
tab = RandomItemEnch.begin();
entry = urand(1, RandomItemEnch.size()) - 1;
for (uint32 i = 0; i < entry; ++i)
++tab;
/* To do: Find randomproperty/suffix based on item level. */
}
else
tab = RandomItemEnch.find(entry);

View File

@@ -2256,7 +2256,7 @@ void ObjectMgr::LoadItemPrototypes()
const_cast<ItemPrototype*>(proto)->Sheath = SHEATHETYPE_NONE;
}
if (proto->RandomProperty && !sItemRandomPropertiesStore.LookupEntry(GetItemEnchantMod(proto->RandomProperty)))
if (proto->RandomProperty > 0 && !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;