From 510af32dad4013c16a186f19af6f710757099e26 Mon Sep 17 00:00:00 2001 From: Vayle <76063792+Valorith@users.noreply.github.com> Date: Wed, 18 Mar 2026 20:09:59 -0400 Subject: [PATCH] Investigate groundspawn desync --- CMakeLists.txt | 6 +++++- libs/luabind/CMakeLists.txt | 2 +- zone/CMakeLists.txt | 2 +- zone/object.cpp | 5 ++--- zone/zone.cpp | 10 ++++++++++ 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a831e2126..1800235c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,11 @@ if(UNIX) endif() endif() -find_package(Boost REQUIRED COMPONENTS dynamic_bitset foreach tuple) +find_package(Boost REQUIRED) +set(EQEMU_BOOST_HEADER_TARGET Boost::headers) +if(NOT TARGET Boost::headers) + set(EQEMU_BOOST_HEADER_TARGET Boost::boost) +endif() find_package(cereal CONFIG REQUIRED) find_package(fmt CONFIG REQUIRED) find_package(glm CONFIG REQUIRED) diff --git a/libs/luabind/CMakeLists.txt b/libs/luabind/CMakeLists.txt index 1588e882d..7e84ca325 100644 --- a/libs/luabind/CMakeLists.txt +++ b/libs/luabind/CMakeLists.txt @@ -23,7 +23,7 @@ set(lb_sources add_library(luabind ${lb_sources}) target_include_directories(luabind PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${LUAJIT_INCLUDE_DIR}) -target_link_libraries(luabind PUBLIC Boost::dynamic_bitset Boost::tuple Boost::foreach ${LUAJIT_LIBRARY}) +target_link_libraries(luabind PUBLIC ${EQEMU_BOOST_HEADER_TARGET} ${LUAJIT_LIBRARY}) target_include_directories(luabind PRIVATE ..) if(UNIX) diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index afb2ca531..ca6c34cf0 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -685,7 +685,7 @@ add_definitions(-DZONE) if(EQEMU_BUILD_LUA) target_compile_definitions(lua_zone PUBLIC LUA_EQEMU) - target_link_libraries(lua_zone PUBLIC luabind Boost::dynamic_bitset Boost::tuple Boost::foreach common) + target_link_libraries(lua_zone PUBLIC luabind ${EQEMU_BOOST_HEADER_TARGET} common) if (EQEMU_BUILD_STATIC AND LUA_LIBRARY) target_link_libraries(zone PRIVATE ${LUA_LIBRARY}) endif() diff --git a/zone/object.cpp b/zone/object.cpp index 8eca194dd..7177217d6 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -679,9 +679,8 @@ bool Object::HandleClick(Client* sender, const ClickObject_Struct* click_object) } } - // Transfer item to client - sender->PutItemInInventory(EQ::invslot::slotCursor, *m_inst, false); - sender->SendItemPacket(EQ::invslot::slotCursor, m_inst, ItemPacketTrade); + // Transfer item to client using the normal cursor update path. + sender->PutItemInInventory(EQ::invslot::slotCursor, *m_inst, true); sender->CheckItemDiscoverability(m_inst->GetID()); diff --git a/zone/zone.cpp b/zone/zone.cpp index 34a635b3b..c7dc8f186 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -354,6 +354,16 @@ bool Zone::LoadGroundSpawns() { const uint32 max_allowed = g.spawn[slot_id].max_allowed; if (inst) { + const auto* item = inst->GetItem(); + if ( + item && + !inst->IsStackable() && + inst->GetCharges() == 0 && + item->MaxCharges > 0 + ) { + inst->SetCharges(item->MaxCharges); + } + for (uint32 i = 0; i < max_allowed; i++) { auto object = new Object( inst,