mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
Ignore zero-id forced quest removals to prevent spawn spam
This commit is contained in:
parent
79903cfdd4
commit
cabf897683
1 changed files with 17 additions and 4 deletions
|
|
@ -1764,30 +1764,43 @@ void GameHandler::handlePacket(network::Packet& packet) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
uint32_t questId = packet.readUInt32();
|
uint32_t questId = packet.readUInt32();
|
||||||
|
if (questId == 0) {
|
||||||
|
// Some servers emit a zero-id variant during world bootstrap.
|
||||||
|
// Treat as no-op to avoid false "Quest removed" spam.
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool removed = false;
|
||||||
std::string removedTitle;
|
std::string removedTitle;
|
||||||
for (auto it = questLog_.begin(); it != questLog_.end(); ++it) {
|
for (auto it = questLog_.begin(); it != questLog_.end(); ++it) {
|
||||||
if (it->questId == questId) {
|
if (it->questId == questId) {
|
||||||
removedTitle = it->title;
|
removedTitle = it->title;
|
||||||
questLog_.erase(it);
|
questLog_.erase(it);
|
||||||
|
removed = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (currentQuestDetails.questId == questId) {
|
if (currentQuestDetails.questId == questId) {
|
||||||
questDetailsOpen = false;
|
questDetailsOpen = false;
|
||||||
currentQuestDetails = QuestDetailsData{};
|
currentQuestDetails = QuestDetailsData{};
|
||||||
|
removed = true;
|
||||||
}
|
}
|
||||||
if (currentQuestRequestItems_.questId == questId) {
|
if (currentQuestRequestItems_.questId == questId) {
|
||||||
questRequestItemsOpen_ = false;
|
questRequestItemsOpen_ = false;
|
||||||
currentQuestRequestItems_ = QuestRequestItemsData{};
|
currentQuestRequestItems_ = QuestRequestItemsData{};
|
||||||
|
removed = true;
|
||||||
}
|
}
|
||||||
if (currentQuestOfferReward_.questId == questId) {
|
if (currentQuestOfferReward_.questId == questId) {
|
||||||
questOfferRewardOpen_ = false;
|
questOfferRewardOpen_ = false;
|
||||||
currentQuestOfferReward_ = QuestOfferRewardData{};
|
currentQuestOfferReward_ = QuestOfferRewardData{};
|
||||||
|
removed = true;
|
||||||
}
|
}
|
||||||
if (!removedTitle.empty()) {
|
if (removed) {
|
||||||
addSystemChatMessage("Quest removed: " + removedTitle);
|
if (!removedTitle.empty()) {
|
||||||
} else {
|
addSystemChatMessage("Quest removed: " + removedTitle);
|
||||||
addSystemChatMessage("Quest removed (ID " + std::to_string(questId) + ").");
|
} else {
|
||||||
|
addSystemChatMessage("Quest removed (ID " + std::to_string(questId) + ").");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue