Core/Weather: Fixed weather updates to be thread safe

This commit is contained in:
Shauren
2017-09-14 22:33:40 +02:00
parent 6d2bc7abf4
commit 6eb9973947
11 changed files with 103 additions and 146 deletions

View File

@@ -21,15 +21,13 @@
*/
#include "Weather.h"
#include "WorldPacket.h"
#include "Player.h"
#include "World.h"
#include "Log.h"
#include "Util.h"
#include "ScriptMgr.h"
#include "WorldSession.h"
#include "MiscPackets.h"
#include "Player.h"
#include "Random.h"
#include "ScriptMgr.h"
#include "Util.h"
#include "World.h"
/// Create the Weather object
Weather::Weather(uint32 zone, WeatherData const* weatherChances)
@@ -195,7 +193,13 @@ bool Weather::ReGenerate()
void Weather::SendWeatherUpdateToPlayer(Player* player)
{
WorldPackets::Misc::Weather weather(GetWeatherState(), m_grade);
player->GetSession()->SendPacket(weather.Write());
player->SendDirectMessage(weather.Write());
}
void Weather::SendFineWeatherUpdateToPlayer(Player* player)
{
WorldPackets::Misc::Weather weather(WEATHER_STATE_FINE);
player->SendDirectMessage(weather.Write());
}
/// Send the new weather to all players in the zone