mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Weather: Fixed weather updates to be thread safe
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user