From a62aba3fc37991067ae8d2332df71d59cf5a3513 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 28 Aug 2025 22:50:26 +0000 Subject: [PATCH 2/5] Enhance SummonItemIntoInventory to support stacking Co-authored-by: Valorith <76063792+Valorith@users.noreply.github.com> --- zone/inventory.cpp | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 1c2b62c4f..847368d1b 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -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) From 16159398d8a69c53a719a1d54d068bbe0fa5284c Mon Sep 17 00:00:00 2001 From: Vayle <76063792+Valorith@users.noreply.github.com> Date: Thu, 2 Oct 2025 21:12:35 -0400 Subject: [PATCH 3/5] Update .gitignore --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index 627d3c630..1eb0c6ca8 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,8 @@ compile_flags.txt # CMake Files cmake-build-relwithdebinfo/* skill-caps.diff +submodules/cereal +submodules/fmt +submodules/libuv +submodules/recastnavigation +submodules/websocketpp From 82ae3580789bc5d70d7764d200840d83e4251eb0 Mon Sep 17 00:00:00 2001 From: Vayle <76063792+Valorith@users.noreply.github.com> Date: Thu, 2 Oct 2025 21:13:23 -0400 Subject: [PATCH 4/5] Revert "Update .gitignore" This reverts commit 16159398d8a69c53a719a1d54d068bbe0fa5284c. --- .gitignore | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.gitignore b/.gitignore index 1eb0c6ca8..627d3c630 100644 --- a/.gitignore +++ b/.gitignore @@ -69,8 +69,3 @@ compile_flags.txt # CMake Files cmake-build-relwithdebinfo/* skill-caps.diff -submodules/cereal -submodules/fmt -submodules/libuv -submodules/recastnavigation -submodules/websocketpp From e32d57dd90c809b72f098417eeaf9327eae63ac6 Mon Sep 17 00:00:00 2001 From: Vayle <76063792+Valorith@users.noreply.github.com> Date: Thu, 2 Oct 2025 23:02:10 -0400 Subject: [PATCH 5/5] 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. --- common/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 2a3c3ad72..1cd88b9e6 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -843,6 +843,11 @@ ENDIF (UNIX) IF (EQEMU_BUILD_PCH) 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 () SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)