mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
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:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user