From a4fa4bb390021e0ec1e983de72bbfc45705219f4 Mon Sep 17 00:00:00 2001 From: Giuseppe Montesanto Date: Sat, 31 Dec 2011 17:42:20 +0100 Subject: Fix the bonus socket activation with prismatic sockets. --- src/server/game/Entities/Item/Item.cpp | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src/server') 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 -- cgit v1.2.3