From d453ba89b25f995a78d4589d4559c5b1b2c15610 Mon Sep 17 00:00:00 2001 From: nimetu Date: Mon, 14 Feb 2022 18:51:04 +0200 Subject: [PATCH] Fix Weapon does not show in both hands on load-in --- ryzom/client/src/interface_v3/inventory_manager.cpp | 13 +++++++++++++ ryzom/client/src/interface_v3/inventory_manager.h | 1 + ryzom/client/src/net_manager.cpp | 2 ++ 3 files changed, 16 insertions(+) diff --git a/ryzom/client/src/interface_v3/inventory_manager.cpp b/ryzom/client/src/interface_v3/inventory_manager.cpp index 04ad896bc..3ab20c15c 100644 --- a/ryzom/client/src/interface_v3/inventory_manager.cpp +++ b/ryzom/client/src/interface_v3/inventory_manager.cpp @@ -1168,6 +1168,19 @@ void CInventoryManager::unequip(const std::string &invPath) } } +void CInventoryManager::onUpdateEquipHands() +{ + // update hands slots after initial BAG inventory has received + CCDBNodeLeaf *pNL; + pNL = NLGUI::CDBManager::getInstance()->getDbProp(LOCAL_INVENTORY ":HAND:0:INDEX_IN_BAG", false); + if (pNL && pNL->getValue32() != 0) + _DBEquipObs.update(pNL); + + pNL = NLGUI::CDBManager::getInstance()->getDbProp(LOCAL_INVENTORY ":HAND:1:INDEX_IN_BAG", false); + if (pNL && pNL->getValue32() != 0) + _DBEquipObs.update(pNL); +} + // *************************************************************************** // Observer on DB equipment branch diff --git a/ryzom/client/src/interface_v3/inventory_manager.h b/ryzom/client/src/interface_v3/inventory_manager.h index d5bd763f1..99283b6f8 100644 --- a/ryzom/client/src/interface_v3/inventory_manager.h +++ b/ryzom/client/src/interface_v3/inventory_manager.h @@ -305,6 +305,7 @@ public: // Called on impulse void onReceiveItemInfo(const CItemInfos &itemInfo); void onRefreshItemInfoVersion(uint16 slotId, uint8 infoVersion); + void onUpdateEquipHands(); // Log for debug void debugItemInfoWaiters(); void debugItemInfoCache() const; diff --git a/ryzom/client/src/net_manager.cpp b/ryzom/client/src/net_manager.cpp index 549732372..5edefdf38 100644 --- a/ryzom/client/src/net_manager.cpp +++ b/ryzom/client/src/net_manager.cpp @@ -2890,6 +2890,8 @@ void impulseInitInventory (NLMISC::CBitMemStream &impulse) impulseUpdateInventory( impulse ); IngameDbMngr.setInitPacketReceived(); nlinfo( "DB_INIT:INV done (%u bytes)", impulse.getPos()-p ); + + getInventory().onUpdateEquipHands(); } //-----------------------------------------------