Merge pull request #5 from Valorith/copilot/fix-ff2b6de1-c436-4d71-b9f4-dfeb78b9fa7f

Enhance SummonItemIntoInventory to support stacking of items
This commit is contained in:
Vayle
2025-10-04 14:45:33 -04:00
committed by GitHub
2 changed files with 30 additions and 19 deletions
+25 -19
View File
@@ -4607,26 +4607,32 @@ void Client::SummonItemIntoInventory(
return;
}
const bool is_arrow = inst->GetItem()->ItemType == EQ::item::ItemTypeArrow;
const int16 slot_id = m_inv.FindFreeSlot(
inst->IsClassBag(),
true,
inst->GetItem()->Size,
is_arrow
);
// Try stacking first if the item is stackable, then fall back to finding a free slot
if (!PutItemInInventoryWithStacking(inst)) {
// PutItemInInventoryWithStacking failed, fall back to original behavior
const bool is_arrow = inst->GetItem()->ItemType == EQ::item::ItemTypeArrow;
const int16 slot_id = m_inv.FindFreeSlot(
inst->IsClassBag(),
true,
inst->GetItem()->Size,
is_arrow
);
SummonItem(
item_id,
charges,
aug1,
aug2,
aug3,
aug4,
aug5,
aug6,
is_attuned,
slot_id
);
SummonItem(
item_id,
charges,
aug1,
aug2,
aug3,
aug4,
aug5,
aug6,
is_attuned,
slot_id
);
}
safe_delete(inst);
}
bool Client::HasItemOnCorpse(uint32 item_id)