aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-06-27 11:48:33 +0200
committerMachiavelli <none@none>2010-06-27 11:48:33 +0200
commit60349c57003656d7513a6741b17580ff1639b0cd (patch)
treebc9437eaca017b779c043b4d04a47a1ab5148865 /src
parent499fa9b7cbff18f48529a0b838d63a2af9bb4df3 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Item/ItemEnchantmentMgr.cpp5
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp2
2 files changed, 2 insertions, 5 deletions
diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
index 5d8d6ef25ce..c363f305451 100644
--- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
+++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp
@@ -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);
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 00fbc83244c..38df034ccc4 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -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;