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();