mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-30 21:57:01 +01:00
Core/Packets: updated SMSG_WEATHER and SMSG_OVERRIDE_LIGHT to packet class
This commit is contained in:
@@ -4679,13 +4679,13 @@ void Map::SendZoneDynamicInfo(uint32 zoneId, Player* player) const
|
||||
|
||||
SendZoneWeather(itr->second, player);
|
||||
|
||||
if (uint32 overrideLight = itr->second.OverrideLightId)
|
||||
if (uint32 overrideLightId = itr->second.OverrideLightId)
|
||||
{
|
||||
WorldPacket data(SMSG_OVERRIDE_LIGHT, 4 + 4 + 1);
|
||||
data << uint32(_defaultLight);
|
||||
data << uint32(overrideLight);
|
||||
data << uint32(itr->second.LightFadeInTime);
|
||||
player->SendDirectMessage(&data);
|
||||
WorldPackets::Misc::OverrideLight overrideLight;
|
||||
overrideLight.AreaLightID = _defaultLight;
|
||||
overrideLight.OverrideLightID = overrideLightId;
|
||||
overrideLight.TransitionMilliseconds = itr->second.LightFadeInTime;
|
||||
player->SendDirectMessage(overrideLight.Write());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4705,11 +4705,8 @@ void Map::SendZoneWeather(ZoneDynamicInfo const& zoneDynamicInfo, Player* player
|
||||
{
|
||||
if (WeatherState weatherId = zoneDynamicInfo.WeatherId)
|
||||
{
|
||||
WorldPacket data(SMSG_WEATHER, 4 + 4 + 1);
|
||||
data << uint32(weatherId);
|
||||
data << float(zoneDynamicInfo.WeatherGrade);
|
||||
data << uint8(0);
|
||||
player->SendDirectMessage(&data);
|
||||
WorldPackets::Misc::Weather weather(weatherId, zoneDynamicInfo.WeatherGrade);
|
||||
player->SendDirectMessage(weather.Write());
|
||||
}
|
||||
else if (zoneDynamicInfo.DefaultWeather)
|
||||
{
|
||||
@@ -4759,15 +4756,13 @@ void Map::SetZoneWeather(uint32 zoneId, WeatherState weatherId, float weatherGra
|
||||
|
||||
if (!players.isEmpty())
|
||||
{
|
||||
WorldPacket data(SMSG_WEATHER, 4 + 4 + 1);
|
||||
data << uint32(weatherId);
|
||||
data << float(weatherGrade);
|
||||
data << uint8(0);
|
||||
WorldPackets::Misc::Weather weather(weatherId, weatherGrade);
|
||||
weather.Write();
|
||||
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
if (player->GetZoneId() == zoneId)
|
||||
player->SendDirectMessage(&data);
|
||||
player->SendDirectMessage(weather.GetRawPacket());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4780,15 +4775,16 @@ void Map::SetZoneOverrideLight(uint32 zoneId, uint32 lightId, uint32 fadeInTime)
|
||||
|
||||
if (!players.isEmpty())
|
||||
{
|
||||
WorldPacket data(SMSG_OVERRIDE_LIGHT, 4 + 4 + 1);
|
||||
data << uint32(_defaultLight);
|
||||
data << uint32(lightId);
|
||||
data << uint32(fadeInTime);
|
||||
WorldPackets::Misc::OverrideLight overrideLight;
|
||||
overrideLight.AreaLightID = _defaultLight;
|
||||
overrideLight.OverrideLightID = lightId;
|
||||
overrideLight.TransitionMilliseconds = fadeInTime;
|
||||
overrideLight.Write();
|
||||
|
||||
for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
if (player->GetZoneId() == zoneId)
|
||||
player->SendDirectMessage(&data);
|
||||
player->SendDirectMessage(overrideLight.GetRawPacket());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user