diff --git a/common/inventory_profile.cpp b/common/inventory_profile.cpp index 03b1df4e0..ae17a2a17 100644 --- a/common/inventory_profile.cpp +++ b/common/inventory_profile.cpp @@ -293,18 +293,13 @@ bool EQEmu::InventoryProfile::DeleteItem(int16 slot_id, uint8 quantity) } // Checks All items in a bag for No Drop -bool EQEmu::InventoryProfile::CheckNoDrop(int16 slot_id) { +bool EQEmu::InventoryProfile::CheckNoDrop(int16 slot_id, bool recurse) +{ ItemInstance* inst = GetItem(slot_id); - if (!inst) return false; - if (!inst->GetItem()->NoDrop) return true; - if (inst->GetItem()->ItemClass == 1) { - for (uint8 i = inventory::containerBegin; i < inventory::ContainerCount; i++) { - ItemInstance* bagitem = GetItem(InventoryProfile::CalcSlotId(slot_id, i)); - if (bagitem && !bagitem->GetItem()->NoDrop) - return true; - } - } - return false; + if (!inst) + return false; + + return (!inst->IsDroppable(recurse)); } // Remove item from bucket without memory delete diff --git a/common/inventory_profile.h b/common/inventory_profile.h index 336bb47d8..b9ae1db8c 100644 --- a/common/inventory_profile.h +++ b/common/inventory_profile.h @@ -133,7 +133,7 @@ namespace EQEmu bool DeleteItem(int16 slot_id, uint8 quantity = 0); // Checks All items in a bag for No Drop - bool CheckNoDrop(int16 slot_id); + bool CheckNoDrop(int16 slot_id, bool recurse = true); // Remove item from inventory (and take control of memory) ItemInstance* PopItem(int16 slot_id); diff --git a/zone/client.h b/zone/client.h index 8bb996bdf..803540ffb 100644 --- a/zone/client.h +++ b/zone/client.h @@ -825,7 +825,7 @@ public: bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, bool attuned = false, uint16 to_slot = EQEmu::inventory::slotCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0); void SetStats(uint8 type,int16 set_val); void IncStats(uint8 type,int16 increase_val); - void DropItem(int16 slot_id); + void DropItem(int16 slot_id, bool recurse = true); int GetItemLinkHash(const EQEmu::ItemInstance* inst); // move to ItemData..or make use of the pre-calculated database field diff --git a/zone/inventory.cpp b/zone/inventory.cpp index c5d7de0fe..d86de7fd8 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -594,9 +594,9 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, } // Drop item from inventory to ground (generally only dropped from SLOT_CURSOR) -void Client::DropItem(int16 slot_id) +void Client::DropItem(int16 slot_id, bool recurse) { - if(GetInv().CheckNoDrop(slot_id) && RuleI(World, FVNoDropFlag) == 0 || + if(GetInv().CheckNoDrop(slot_id, recurse) && RuleI(World, FVNoDropFlag) == 0 || RuleI(Character, MinStatusForNoDropExemptions) < Admin() && RuleI(World, FVNoDropFlag) == 2) { database.SetHackerFlag(this->AccountName(), this->GetCleanName(), "Tried to drop an item on the ground that was nodrop!"); GetInv().DeleteItem(slot_id);