mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-14 20:12:26 +00:00
More NoDrop-related hack abatement
This commit is contained in:
parent
06279b18a3
commit
648078d76c
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user