fix(loot): send GAMEOBJ_REPORT_USE when supported
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run

This commit is contained in:
Kelsi 2026-03-14 04:47:34 -07:00
parent 5a63d3799c
commit 251ed7733b

View file

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