mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-03 20:03:50 +00:00
fix: quest objective GOs never granted credit — REPORT_USE skipped for chests
CMSG_GAMEOBJ_REPORT_USE was only sent for non-chest GOs. Chest-type (type=3) and name-matched chest-like GOs (Bundle of Wood, etc.) went through a separate path that sent CMSG_GAMEOBJ_USE + CMSG_LOOT but skipped REPORT_USE. On AzerothCore, REPORT_USE triggers the server-side HandleGameobjectReportUse which calls GossipHello on the GO script — this is where many quest objective scripts grant credit. Restructured so CMSG_GAMEOBJ_USE is sent first for all GO types, then chest-like GOs additionally send CMSG_LOOT, and REPORT_USE fires for everything except mailboxes.
This commit is contained in:
parent
f23a7c06d9
commit
c1c28d4216
1 changed files with 28 additions and 30 deletions
|
|
@ -6213,22 +6213,18 @@ void GameHandler::performGameObjectInteractionNow(uint64_t guid) {
|
|||
" entry=", goEntry, " type=", goType,
|
||||
" name='", goName, "' chestLike=", chestLike, " isMailbox=", isMailbox);
|
||||
|
||||
if (chestLike) {
|
||||
// For chest-like GOs: send CMSG_GAMEOBJ_USE (opens the chest) followed
|
||||
// immediately by CMSG_LOOT (requests loot contents). Both sent in the
|
||||
// same frame so the server processes them sequentially: USE transitions
|
||||
// the GO to lootable state, then LOOT reads the contents.
|
||||
// Always send CMSG_GAMEOBJ_USE first — this triggers the server-side
|
||||
// GameObject::Use() handler for all GO types.
|
||||
auto usePacket = GameObjectUsePacket::build(guid);
|
||||
socket->send(usePacket);
|
||||
lootTarget(guid);
|
||||
lastInteractedGoGuid_ = guid;
|
||||
} else {
|
||||
// Non-chest GOs (doors, buttons, quest givers, etc.): use CMSG_GAMEOBJ_USE
|
||||
auto packet = GameObjectUsePacket::build(guid);
|
||||
socket->send(packet);
|
||||
lastInteractedGoGuid_ = guid;
|
||||
|
||||
if (isMailbox) {
|
||||
if (chestLike) {
|
||||
// Chest-like GOs also need a CMSG_LOOT to open the loot window.
|
||||
// Sent in the same frame: USE transitions the GO to lootable state,
|
||||
// then LOOT requests the contents.
|
||||
lootTarget(guid);
|
||||
} else if (isMailbox) {
|
||||
LOG_INFO("Mailbox interaction: opening mail UI and requesting mail list");
|
||||
mailboxGuid_ = guid;
|
||||
mailboxOpen_ = true;
|
||||
|
|
@ -6238,7 +6234,10 @@ void GameHandler::performGameObjectInteractionNow(uint64_t guid) {
|
|||
refreshMailList();
|
||||
}
|
||||
|
||||
// CMSG_GAMEOBJ_REPORT_USE for GO AI scripts (quest givers, etc.)
|
||||
// CMSG_GAMEOBJ_REPORT_USE triggers GO AI scripts (SmartAI, ScriptAI) which
|
||||
// is where many quest objectives grant credit. Previously this was only sent
|
||||
// for non-chest GOs, so chest-type quest objectives (Bundle of Wood, etc.)
|
||||
// never triggered the server-side quest credit script.
|
||||
if (!isMailbox) {
|
||||
const auto* table = getActiveOpcodeTable();
|
||||
if (table && table->hasOpcode(Opcode::CMSG_GAMEOBJ_REPORT_USE)) {
|
||||
|
|
@ -6247,7 +6246,6 @@ void GameHandler::performGameObjectInteractionNow(uint64_t guid) {
|
|||
socket->send(reportUse);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameHandler::selectGossipOption(uint32_t optionId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue