Skip to content

Commit

Permalink
Fix weather packet in earlier versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Oct 9, 2024
1 parent 08d3581 commit f93cab1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/game/Weather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,12 @@ void Weather::SendWeatherUpdateToPlayer(Player* player)
WorldPacket data(SMSG_WEATHER, 4 + 4 + 4 + 1);
data << uint32(m_type);
data << float(m_grade);
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_8_4
data << uint32(GetSound()); // 1.12 soundid
#endif
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_9_4
data << uint8(0); // 1 = instant change, 0 = smooth change

#endif
player->GetSession()->SendPacket(&data);
#endif
}
Expand All @@ -233,9 +236,12 @@ bool Weather::SendWeatherForPlayersInZone(Map const* _map)
WorldPacket data(SMSG_WEATHER, 4 + 4 + 4 + 1);
data << uint32(m_type);
data << float(m_grade);
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_8_4
data << uint32(GetSound()); // 1.12 soundid
#endif
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_9_4
data << uint8(0); // 1 = instant change, 0 = smooth change

#endif
// Send the weather packet to all players in this zone
if (!_map->SendToPlayersInZone(&data, m_zone))
return false;
Expand Down

0 comments on commit f93cab1

Please sign in to comment.