mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
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])
|
||||
{
|
||||
// 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
|
||||
if (iGemProto->ItemLimitCategory == Gems[j]->GetProto()->ItemLimitCategory)
|
||||
++limit_newcount;
|
||||
}
|
||||
// existed gem
|
||||
else if (OldEnchants[j])
|
||||
{
|
||||
// existing gem
|
||||
if (SpellItemEnchantmentEntry const* enchantEntry = sSpellItemEnchantmentStore.LookupEntry(OldEnchants[j]))
|
||||
if (ItemPrototype const* jProto = ObjectMgr::GetItemPrototype(enchantEntry->GemID))
|
||||
if (iGemProto->ItemLimitCategory == jProto->ItemLimitCategory)
|
||||
|
||||
Reference in New Issue
Block a user