mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-09 11:02:27 +00:00
Enhance SummonItemIntoInventory to support stacking
Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com>
This commit is contained in:
parent
85d84bff75
commit
a62aba3fc3
@ -4607,6 +4607,9 @@ void Client::SummonItemIntoInventory(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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 bool is_arrow = inst->GetItem()->ItemType == EQ::item::ItemTypeArrow;
|
||||||
const int16 slot_id = m_inv.FindFreeSlot(
|
const int16 slot_id = m_inv.FindFreeSlot(
|
||||||
inst->IsClassBag(),
|
inst->IsClassBag(),
|
||||||
@ -4629,6 +4632,9 @@ void Client::SummonItemIntoInventory(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
safe_delete(inst);
|
||||||
|
}
|
||||||
|
|
||||||
bool Client::HasItemOnCorpse(uint32 item_id)
|
bool Client::HasItemOnCorpse(uint32 item_id)
|
||||||
{
|
{
|
||||||
auto corpses = CharacterCorpsesRepository::GetWhere(database, fmt::format("charid = {}", CharacterID()));
|
auto corpses = CharacterCorpsesRepository::GetWhere(database, fmt::format("charid = {}", CharacterID()));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user