diff options
author | Shauren <krzysiek.7.5.4@gmail.com> | 2011-12-31 13:25:30 -0800 |
---|---|---|
committer | Shauren <krzysiek.7.5.4@gmail.com> | 2011-12-31 13:25:30 -0800 |
commit | bd37ed23c940661498823d8eb17e1a14c7149e38 (patch) | |
tree | ac4ddd2ce38f315b41da9b14e88bd914b6ce3d2b | |
parent | 73cf793e56b0750f717f31d91f54fdf94ff88682 (diff) | |
parent | a4fa4bb390021e0ec1e983de72bbfc45705219f4 (diff) |
Merge pull request #4559 from devilcoredev/fix_004
Core/Items: Fixed socket bonus activation with prismatic sockets.
-rwxr-xr-x | src/server/game/Entities/Item/Item.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 07275166130..6589cf6cd7b 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -931,24 +931,20 @@ void Item::ClearEnchantment(EnchantmentSlot slot) bool Item::GemsFitSockets() const { - bool fits = true; for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot) { uint8 SocketColor = GetTemplate()->Socket[enchant_slot-SOCK_ENCHANTMENT_SLOT].Color; - uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)); - if (!enchant_id) - { - if (SocketColor) fits &= false; + if (!SocketColor) // no socket slot continue; - } + + uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot)); + if (!enchant_id) // no gems on this socket + return false; SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(enchant_id); - if (!enchantEntry) - { - if (SocketColor) fits &= false; - continue; - } + if (!enchantEntry) // invalid gem id on this socket + return false; uint8 GemColor = 0; @@ -964,9 +960,10 @@ bool Item::GemsFitSockets() const } } - fits &= (GemColor & SocketColor) ? true : false; + if (!(GemColor & SocketColor)) // bad gem color on this socket + return false; } - return fits; + return true; } uint8 Item::GetGemCountWithID(uint32 GemID) const |