mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
fix: show quest name instead of ID in failed/timed-out quest messages
SMSG_QUESTUPDATE_FAILED and SMSG_QUESTUPDATE_FAILEDTIMER were emitting generic "Quest 12345 failed!" messages. Now looks up the title from questLog_ and shows e.g. "\"Report to Gryan Stoutmantle\" failed!" for a much more readable notification. Falls back to the generic form if the title is not cached.
This commit is contained in:
parent
156ddfad9a
commit
2a52aedbf7
1 changed files with 12 additions and 6 deletions
|
|
@ -1845,9 +1845,12 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
|||
// uint32 questId
|
||||
if (packet.getSize() - packet.getReadPos() >= 4) {
|
||||
uint32_t questId = packet.readUInt32();
|
||||
char buf[128];
|
||||
std::snprintf(buf, sizeof(buf), "Quest %u failed!", questId);
|
||||
addSystemChatMessage(buf);
|
||||
std::string questTitle;
|
||||
for (const auto& q : questLog_)
|
||||
if (q.questId == questId && !q.title.empty()) { questTitle = q.title; break; }
|
||||
addSystemChatMessage(questTitle.empty()
|
||||
? std::string("Quest failed!")
|
||||
: ('"' + questTitle + "\" failed!"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -1855,9 +1858,12 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
|||
// uint32 questId
|
||||
if (packet.getSize() - packet.getReadPos() >= 4) {
|
||||
uint32_t questId = packet.readUInt32();
|
||||
char buf[128];
|
||||
std::snprintf(buf, sizeof(buf), "Quest %u timed out!", questId);
|
||||
addSystemChatMessage(buf);
|
||||
std::string questTitle;
|
||||
for (const auto& q : questLog_)
|
||||
if (q.questId == questId && !q.title.empty()) { questTitle = q.title; break; }
|
||||
addSystemChatMessage(questTitle.empty()
|
||||
? std::string("Quest timed out!")
|
||||
: ('"' + questTitle + "\" has timed out."));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue