From 82e63fc95d91262911dc9aff34d97e8e1643ccaf Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 6 Feb 2026 03:13:42 -0800 Subject: [PATCH] Trigger player model visual update when online inventory changes rebuildOnlineInventory() now sets a dirty flag that GameScreen checks each frame to call updateCharacterGeosets/Textures and loadEquippedWeapons. --- include/game/game_handler.hpp | 2 ++ src/game/game_handler.cpp | 2 ++ src/ui/game_screen.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/game/game_handler.hpp b/include/game/game_handler.hpp index f4783a7a..fd14631c 100644 --- a/include/game/game_handler.hpp +++ b/include/game/game_handler.hpp @@ -190,6 +190,7 @@ public: // Inventory Inventory& getInventory() { return inventory; } const Inventory& getInventory() const { return inventory; } + bool consumeOnlineEquipmentDirty() { bool d = onlineEquipDirty_; onlineEquipDirty_ = false; return d; } // Targeting void setTarget(uint64_t guid); @@ -548,6 +549,7 @@ private: std::unordered_set pendingItemQueries_; std::array equipSlotGuids_{}; std::array backpackSlotGuids_{}; + bool onlineEquipDirty_ = false; // ---- Phase 2: Combat ---- bool autoAttacking = false; diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 0ed8396e..fe774da4 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -2936,6 +2936,8 @@ void GameHandler::rebuildOnlineInventory() { inventory.setBackpackSlot(i, def); } + onlineEquipDirty_ = true; + LOG_DEBUG("Rebuilt online inventory: equip=", [&](){ int c = 0; for (auto g : equipSlotGuids_) if (g) c++; return c; }(), " backpack=", [&](){ diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 64a9f0eb..35a4fc6f 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -104,7 +104,7 @@ void GameScreen::render(game::GameHandler& gameHandler) { gameHandler.notifyInventoryChanged(); } - if (inventoryScreen.consumeEquipmentDirty()) { + if (inventoryScreen.consumeEquipmentDirty() || gameHandler.consumeOnlineEquipmentDirty()) { updateCharacterGeosets(gameHandler.getInventory()); updateCharacterTextures(gameHandler.getInventory()); core::Application::getInstance().loadEquippedWeapons();