From 251ed7733b5d7640c1c3f16dc61177eeb70a1db8 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 14 Mar 2026 04:47:34 -0700 Subject: [PATCH] fix(loot): send GAMEOBJ_REPORT_USE when supported --- src/game/game_handler.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index f4c2bf6c..efaee286 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -18372,11 +18372,15 @@ void GameHandler::performGameObjectInteractionNow(uint64_t guid) { lower.find("coffer") != std::string::npos || lower.find("cache") != std::string::npos); } - // For WotLK, CMSG_GAMEOBJ_REPORT_USE is required for chests (and is harmless for others). - if (!isMailbox && isActiveExpansion("wotlk")) { - network::Packet reportUse(wireOpcode(Opcode::CMSG_GAMEOBJ_REPORT_USE)); - reportUse.writeUInt64(guid); - socket->send(reportUse); + // Some servers require CMSG_GAMEOBJ_REPORT_USE for lootable gameobjects. + // Only send it when the active opcode table actually supports it. + if (!isMailbox) { + const auto* table = getActiveOpcodeTable(); + if (table && table->hasOpcode(Opcode::CMSG_GAMEOBJ_REPORT_USE)) { + network::Packet reportUse(wireOpcode(Opcode::CMSG_GAMEOBJ_REPORT_USE)); + reportUse.writeUInt64(guid); + socket->send(reportUse); + } } if (shouldSendLoot) { lootTarget(guid);