fix(Core/Item): Meta gems sometimes ignore added sockets (#3643)

This commit is contained in:
placemolle
2020-11-13 11:24:16 -05:00
committed by GitHub
parent d7becdae27
commit fc63d935b9
3 changed files with 12 additions and 3 deletions

View File

@@ -7992,7 +7992,7 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply)
uint8 attacktype = Player::GetAttackBySlot(slot);
if (proto->Socket[0].Color) //only (un)equipping of items with sockets can influence metagems, so no need to waste time with normal items
if (item->HasSocket()) //only (un)equipping of items with sockets can influence metagems, so no need to waste time with normal items
CorrectMetaGemEnchants(slot, apply);
if (attacktype < MAX_ATTACK)
@@ -22578,7 +22578,7 @@ bool Player::EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot)
if (i == slot)
continue;
Item* pItem2 = GetItemByPos(INVENTORY_SLOT_BAG_0, i);
if (pItem2 && !pItem2->IsBroken() && pItem2->GetTemplate()->Socket[0].Color)
if (pItem2 && !pItem2->IsBroken() && pItem2->HasSocket())
{
for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot <= PRISMATIC_ENCHANTMENT_SLOT; ++enchant_slot)
{
@@ -22660,7 +22660,7 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply)
Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot);
if (!pItem || !pItem->GetTemplate()->Socket[0].Color)
if (!pItem || !pItem->HasSocket())
continue;
for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT + 3; ++enchant_slot)