mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 18:51:29 +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 16159398d8a69c53a719a1d54d068bbe0fa5284c. * 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:
parent
eb4e7d694c
commit
f74efcaa5f
@ -842,6 +842,11 @@ ENDIF (UNIX)
|
|||||||
|
|
||||||
IF (EQEMU_BUILD_PCH)
|
IF (EQEMU_BUILD_PCH)
|
||||||
TARGET_PRECOMPILE_HEADERS(common PRIVATE pch/std-pch.h)
|
TARGET_PRECOMPILE_HEADERS(common PRIVATE pch/std-pch.h)
|
||||||
|
# Avoid PCH/__OPTIMIZE__ mismatch when compiling certain patch sources with -O0
|
||||||
|
# These files are compiled with -O0 on UNIX (see COMPILE_FLAGS above), which
|
||||||
|
# disables the __OPTIMIZE__ predefined macro. Disabling PCH for them prevents
|
||||||
|
# Clang from erroring due to macro state differences between the PCH and TU.
|
||||||
|
SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/uf.cpp" PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
|
||||||
ENDIF ()
|
ENDIF ()
|
||||||
|
|
||||||
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
|
||||||
|
|||||||
@ -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