mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Fix WotLK quest accept packet parsing and wolf display fallback
- Send CMSG_QUESTGIVER_ACCEPT_QUEST with trailing u8 flag on non-classic expansions to match AzerothCore parsing and prevent opcode 393 ByteBufferException. - Keep classic/turtle on short accept packet format (guid + questId). - Add displayId fallback for 31048/31049 to Creature\Wolf\Wolf.m2 so Diseased Young Wolf variants render instead of being dropped.
This commit is contained in:
parent
eaba378b5b
commit
1f7c220fdb
2 changed files with 20 additions and 2 deletions
|
|
@ -3155,6 +3155,18 @@ void Application::buildCreatureDisplayLookups() {
|
||||||
std::string Application::getModelPathForDisplayId(uint32_t displayId) const {
|
std::string Application::getModelPathForDisplayId(uint32_t displayId) const {
|
||||||
if (displayId == 30412) return "Creature\\Gryphon\\Gryphon.m2";
|
if (displayId == 30412) return "Creature\\Gryphon\\Gryphon.m2";
|
||||||
if (displayId == 30413) return "Creature\\Wyvern\\Wyvern.m2";
|
if (displayId == 30413) return "Creature\\Wyvern\\Wyvern.m2";
|
||||||
|
|
||||||
|
// WotLK servers can send display IDs that do not exist in older/local
|
||||||
|
// CreatureDisplayInfo datasets. Keep those creatures visible by falling
|
||||||
|
// back to a close base model instead of dropping spawn entirely.
|
||||||
|
switch (displayId) {
|
||||||
|
case 31048: // Diseased Young Wolf variants (AzerothCore WotLK)
|
||||||
|
case 31049: // Diseased Wolf variants (AzerothCore WotLK)
|
||||||
|
return "Creature\\Wolf\\Wolf.m2";
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
auto itData = displayDataMap_.find(displayId);
|
auto itData = displayDataMap_.find(displayId);
|
||||||
if (itData == displayDataMap_.end()) {
|
if (itData == displayDataMap_.end()) {
|
||||||
// Some sources (e.g., taxi nodes) may provide a modelId directly.
|
// Some sources (e.g., taxi nodes) may provide a modelId directly.
|
||||||
|
|
|
||||||
|
|
@ -9736,8 +9736,14 @@ void GameHandler::handleQuestDetails(network::Packet& packet) {
|
||||||
void GameHandler::acceptQuest() {
|
void GameHandler::acceptQuest() {
|
||||||
if (!questDetailsOpen || state != WorldState::IN_WORLD || !socket) return;
|
if (!questDetailsOpen || state != WorldState::IN_WORLD || !socket) return;
|
||||||
uint64_t npcGuid = currentQuestDetails.npcGuid;
|
uint64_t npcGuid = currentQuestDetails.npcGuid;
|
||||||
auto packet = QuestgiverAcceptQuestPacket::build(
|
// WotLK/TBC expect an additional trailing flag on CMSG_QUESTGIVER_ACCEPT_QUEST.
|
||||||
npcGuid, currentQuestDetails.questId);
|
// Classic/Turtle use the short form (guid + questId only).
|
||||||
|
network::Packet packet(wireOpcode(Opcode::CMSG_QUESTGIVER_ACCEPT_QUEST));
|
||||||
|
packet.writeUInt64(npcGuid);
|
||||||
|
packet.writeUInt32(currentQuestDetails.questId);
|
||||||
|
if (!isActiveExpansion("classic") && !isActiveExpansion("turtle")) {
|
||||||
|
packet.writeUInt8(1); // from-gossip / auto-accept continuation flag
|
||||||
|
}
|
||||||
socket->send(packet);
|
socket->send(packet);
|
||||||
|
|
||||||
// Add to quest log
|
// Add to quest log
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue