From d3241dce9ef7265825eef8a90a1bbb4d62ec7a68 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 04:25:00 -0700 Subject: [PATCH] fix: handle Classic 1.12 SMSG_WEATHER missing isAbrupt byte Classic 1.12 sends weatherType(4)+intensity(4) with no trailing isAbrupt byte; TBC/WotLK append uint8 isAbrupt. The prior check required >= 9 bytes, so weather never updated on Classic servers. Now accept >= 8 bytes and read isAbrupt only if the byte is present. --- src/game/game_handler.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 18b5a54f..b796f509 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -4078,11 +4078,13 @@ void GameHandler::handlePacket(network::Packet& packet) { break; } case Opcode::SMSG_WEATHER: { - // Format: uint32 weatherType, float intensity, uint8 isAbrupt - if (packet.getSize() - packet.getReadPos() >= 9) { + // Classic 1.12: uint32 weatherType + float intensity (8 bytes, no isAbrupt) + // TBC 2.4.3 / WotLK 3.3.5a: uint32 weatherType + float intensity + uint8 isAbrupt (9 bytes) + if (packet.getSize() - packet.getReadPos() >= 8) { uint32_t wType = packet.readUInt32(); float wIntensity = packet.readFloat(); - /*uint8_t isAbrupt =*/ packet.readUInt8(); + if (packet.getSize() - packet.getReadPos() >= 1) + /*uint8_t isAbrupt =*/ packet.readUInt8(); weatherType_ = wType; weatherIntensity_ = wIntensity; const char* typeName = (wType == 1) ? "Rain" : (wType == 2) ? "Snow" : (wType == 3) ? "Storm" : "Clear";