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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user