mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
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.
This commit is contained in:
parent
fed03f970c
commit
d3241dce9e
1 changed files with 5 additions and 3 deletions
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue