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

@@ -962,6 +962,13 @@ bool Item::GemsFitSockets() const
return true;
}
bool Item::HasSocket() const
{
// There can only be one socket added, and it's always in slot `PRISMATIC_ENCHANTMENT_SLOT`.
// Built-in sockets Socket from upgrade
return this->GetTemplate()->Socket[0].Color || this->GetEnchantmentId(EnchantmentSlot(PRISMATIC_ENCHANTMENT_SLOT));
}
uint8 Item::GetGemCountWithID(uint32 GemID) const
{
uint8 count = 0;

View File

@@ -246,6 +246,8 @@ public:
uint32 GetCount() const { return GetUInt32Value(ITEM_FIELD_STACK_COUNT); }
void SetCount(uint32 value) { SetUInt32Value(ITEM_FIELD_STACK_COUNT, value); }
uint32 GetMaxStackCount() const { return GetTemplate()->GetMaxStackSize(); }
// Checks if this item has sockets, whether built-in or added by an upgrade.
bool HasSocket() const;
uint8 GetGemCountWithID(uint32 GemID) const;
uint8 GetGemCountWithLimitCategory(uint32 limitCategory) const;
InventoryResult CanBeMergedPartlyWith(ItemTemplate const* proto) const;