Core/ItemHandler: Fix a logic error when checking for gem equipment limits. (Socketed gems cannot be destroyed, they can only be replaced and that would be the "new gem" case) - fix by leak
Closes issue 4698. Fixes issue 2495. --HG-- branch : trunk
This commit is contained in:
@@ -1263,22 +1263,13 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
|||||||
{
|
{
|
||||||
if (Gems[j])
|
if (Gems[j])
|
||||||
{
|
{
|
||||||
// destroyed gem
|
|
||||||
if (OldEnchants[j])
|
|
||||||
{
|
|
||||||
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j]))
|
|
||||||
if (ItemPrototype const* jProto = ObjectMgr::GetItemPrototype(enchantEntry->GemID))
|
|
||||||
if (iGemProto->ItemLimitCategory == jProto->ItemLimitCategory)
|
|
||||||
--limit_newcount;
|
|
||||||
}
|
|
||||||
|
|
||||||
// new gem
|
// new gem
|
||||||
if (iGemProto->ItemLimitCategory == Gems[j]->GetProto()->ItemLimitCategory)
|
if (iGemProto->ItemLimitCategory == Gems[j]->GetProto()->ItemLimitCategory)
|
||||||
++limit_newcount;
|
++limit_newcount;
|
||||||
}
|
}
|
||||||
// existed gem
|
|
||||||
else if (OldEnchants[j])
|
else if (OldEnchants[j])
|
||||||
{
|
{
|
||||||
|
// existing gem
|
||||||
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j]))
|
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j]))
|
||||||
if (ItemPrototype const* jProto = ObjectMgr::GetItemPrototype(enchantEntry->GemID))
|
if (ItemPrototype const* jProto = ObjectMgr::GetItemPrototype(enchantEntry->GemID))
|
||||||
if (iGemProto->ItemLimitCategory == jProto->ItemLimitCategory)
|
if (iGemProto->ItemLimitCategory == jProto->ItemLimitCategory)
|
||||||
|
|||||||
Reference in New Issue
Block a user