From 64439673ce323722a8d184d4b352644b895ed2c7 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Mar 2026 03:06:45 -0700 Subject: [PATCH] fix: show repair button when vendor has NPC_FLAG_REPAIR (0x40) set Vendors that open directly (without gossip menu) never triggered the armorer gossip path, so canRepair was always false and the Repair button was hidden. Now also check the NPC's unit flags for NPC_FLAG_REPAIR when the vendor list arrives, fixing armorers accessed directly. --- src/game/game_handler.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index eee30296..6324e391 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -18741,8 +18741,20 @@ void GameHandler::handleGossipComplete(network::Packet& packet) { } void GameHandler::handleListInventory(network::Packet& packet) { - bool savedCanRepair = currentVendorItems.canRepair; // preserve armorer flag set before openVendor() + bool savedCanRepair = currentVendorItems.canRepair; // preserve armorer flag set via gossip path if (!ListInventoryParser::parse(packet, currentVendorItems)) return; + + // Check NPC_FLAG_REPAIR (0x40) on the vendor entity — this handles vendors that open + // directly without going through the gossip armorer option. + if (!savedCanRepair && currentVendorItems.vendorGuid != 0) { + auto entity = entityManager.getEntity(currentVendorItems.vendorGuid); + if (entity && entity->getType() == ObjectType::UNIT) { + auto unit = std::static_pointer_cast(entity); + if (unit->getNpcFlags() & 0x40) { // NPC_FLAG_REPAIR + savedCanRepair = true; + } + } + } currentVendorItems.canRepair = savedCanRepair; vendorWindowOpen = true; gossipWindowOpen = false; // Close gossip if vendor opens