diff --git a/common/item_instance.cpp b/common/item_instance.cpp index e776b04d9..56e0a9b75 100644 --- a/common/item_instance.cpp +++ b/common/item_instance.cpp @@ -303,47 +303,34 @@ int8 EQ::ItemInstance::AvailableAugmentSlot(int32 augment_type) const return INVALID_INDEX; } - auto i = invaug::SOCKET_BEGIN; - for (; i <= invaug::SOCKET_END; ++i) { - if (GetItem(i)) { - continue; - } - - if ( - augment_type == -1 || - ( - m_item->AugSlotType[i] && - ((1 << (m_item->AugSlotType[i] - 1)) & augment_type) - ) - ) { - break; + for (int16 slot_id = invaug::SOCKET_BEGIN; slot_id <= invaug::SOCKET_END; ++slot_id) { + if (IsAugmentSlotAvailable(augment_type, slot_id)) { + return slot_id; } } - return (i <= invaug::SOCKET_END) ? i : INVALID_INDEX; + return INVALID_INDEX; } bool EQ::ItemInstance::IsAugmentSlotAvailable(int32 augment_type, uint8 slot) const { - if (!m_item || !m_item->IsClassCommon()) { + if (!m_item || !m_item->IsClassCommon() || GetItem(slot)) { return false; } - if ( + return ( ( - !GetItem(slot) && - m_item->AugSlotVisible[slot] + augment_type == -1 || + ( + m_item->AugSlotType[slot] && + ((1 << (m_item->AugSlotType[slot] - 1)) & augment_type) + ) ) && - augment_type == -1 || ( - m_item->AugSlotType[slot] && - ((1 << (m_item->AugSlotType[slot] - 1)) & augment_type) + RuleB(Items, AugmentItemAllowInvisibleAugments) || + m_item->AugSlotVisible[slot] ) - ) { - return true; - } - - return false; + ); } // Retrieve item inside container diff --git a/common/ruletypes.h b/common/ruletypes.h index f3c22ce5d..4433d9cb7 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -996,6 +996,8 @@ RULE_BOOL(Items, DisableNoRent, false, "Enable this to disable No Rent Items") RULE_BOOL(Items, DisableNoTransfer, false, "Enable this to disable No Transfer Items") RULE_BOOL(Items, DisablePotionBelt, false, "Enable this to disable Potion Belt Items") RULE_BOOL(Items, DisableSpellFocusEffects, false, "Enable this to disable Spell Focus Effects on Items") +RULE_BOOL(Items, SummonItemAllowInvisibleAugments, false, "Enable this to allow augments to be put in invisible augment slots of items in Client::SummonItem") +RULE_BOOL(Items, AugmentItemAllowInvisibleAugments, false, "Enable this to allow augments to be put in invisible augment slots by players") RULE_CATEGORY_END() RULE_CATEGORY(Parcel) diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 374fa3aa7..f49a5e7ce 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -384,7 +384,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, return false; } - if(item->AugSlotVisible[iter] == 0) { + if (!RuleB(Items, SummonItemAllowInvisibleAugments) && item->AugSlotVisible[iter] == 0) { Message( Chat::Red, fmt::format( @@ -1105,7 +1105,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int16 quantity, bool client_up if(update_db) database.SaveInventory(character_id, inst, slot_id); } - + if(client_update && IsValidSlot(slot_id)) { EQApplicationPacket* outapp = nullptr; if(inst) {