mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 00:03:50 +00:00
fix(vendor): detect repair NPC flag correctly
This commit is contained in:
parent
7e7ad325dc
commit
a2f9ccc9b9
1 changed files with 3 additions and 2 deletions
|
|
@ -19820,13 +19820,14 @@ void GameHandler::handleListInventory(network::Packet& packet) {
|
||||||
bool savedCanRepair = currentVendorItems.canRepair; // preserve armorer flag set via gossip path
|
bool savedCanRepair = currentVendorItems.canRepair; // preserve armorer flag set via gossip path
|
||||||
if (!ListInventoryParser::parse(packet, currentVendorItems)) return;
|
if (!ListInventoryParser::parse(packet, currentVendorItems)) return;
|
||||||
|
|
||||||
// Check NPC_FLAG_REPAIR (0x40) on the vendor entity — this handles vendors that open
|
// Check NPC_FLAG_REPAIR (0x1000) on the vendor entity — this handles vendors that open
|
||||||
// directly without going through the gossip armorer option.
|
// directly without going through the gossip armorer option.
|
||||||
if (!savedCanRepair && currentVendorItems.vendorGuid != 0) {
|
if (!savedCanRepair && currentVendorItems.vendorGuid != 0) {
|
||||||
auto entity = entityManager.getEntity(currentVendorItems.vendorGuid);
|
auto entity = entityManager.getEntity(currentVendorItems.vendorGuid);
|
||||||
if (entity && entity->getType() == ObjectType::UNIT) {
|
if (entity && entity->getType() == ObjectType::UNIT) {
|
||||||
auto unit = std::static_pointer_cast<Unit>(entity);
|
auto unit = std::static_pointer_cast<Unit>(entity);
|
||||||
if (unit->getNpcFlags() & 0x40) { // NPC_FLAG_REPAIR
|
// MaNGOS/Trinity: UNIT_NPC_FLAG_REPAIR = 0x00001000.
|
||||||
|
if (unit->getNpcFlags() & 0x1000) {
|
||||||
savedCanRepair = true;
|
savedCanRepair = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue