mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Bug Fix] Enhance SummonItemIntoInventory() to support stacking of items (#5022)
* Initial plan
* Initial plan
* Enhance SummonItemIntoInventory to support stacking
Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com>
* Update .gitignore
* Revert "Update .gitignore"
This reverts commit 16159398d8.
* Disable PCH for patch sources compiled with -O0
Disables precompiled headers for specific patch source files that are compiled with -O0 on UNIX. This avoids Clang errors caused by __OPTIMIZE__ macro state mismatches between the PCH and translation units.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
+25
-19
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user