fix(Core/Weather): Improve weather system thread safety (#22772)

Co-authored-by: Shauren <shauren.trinity@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Takenbacon
2025-09-29 07:43:30 -07:00
committed by GitHub
parent 5f17121117
commit 22f93eaca6
20 changed files with 186 additions and 247 deletions
+4 -1
View File
@@ -25,6 +25,7 @@
#include "SharedDefines.h"
#include "Timer.h"
class Map;
class Player;
#define WEATHER_SEASONS 4
@@ -63,7 +64,7 @@ enum WeatherState : uint32
class Weather
{
public:
Weather(uint32 zone, WeatherData const* weatherChances);
Weather(Map* map, uint32 zone, WeatherData const* weatherChances);
~Weather() = default;
bool Update(uint32 diff);
@@ -71,6 +72,7 @@ public:
bool UpdateWeather();
void SendWeatherUpdateToPlayer(Player* player);
static void SendFineWeatherUpdateToPlayer(Player* player);
void SetWeather(WeatherType type, float grade);
/// For which zone is this weather?
@@ -79,6 +81,7 @@ public:
private:
[[nodiscard]] WeatherState GetWeatherState() const;
Map* m_map;
uint32 m_zone;
WeatherType m_type;
float m_grade;