diff options
| author | Machiavelli <none@none> | 2010-06-27 19:46:25 +0200 |
|---|---|---|
| committer | Machiavelli <none@none> | 2010-06-27 19:46:25 +0200 |
| commit | 0b063e189baf13889b28cb283a6c7d4f07e1da36 (patch) | |
| tree | 6731f237c972ec773ded324b02af902d66c83da2 | |
| parent | cd47c87a7c9c17af4ab2d28be0964af3400238e1 (diff) | |
Better way to check for RandomProperty == -1, assign 0 to it for now.
--HG--
branch : trunk
| -rw-r--r-- | src/server/game/Entities/Item/ItemEnchantmentMgr.cpp | 11 | ||||
| -rw-r--r-- | src/server/game/Globals/ObjectMgr.cpp | 13 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index c363f305451..440ea0027e8 100644 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -91,15 +91,10 @@ uint32 GetItemEnchantMod(int32 entry) if (!entry) return 0; - EnchantmentStore::const_iterator tab; - if (entry == -1) - { - /* To do: Find randomproperty/suffix based on item level. */ - } - else - tab = RandomItemEnch.find(entry); - + return 0; + + EnchantmentStore::const_iterator tab = RandomItemEnch.find(entry); 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); diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 38df034ccc4..3d6345939f9 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -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))) |
