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

View File

@@ -63,14 +63,8 @@ struct npc_herald_of_the_lich_king : public ScriptedAI
void UpdateWeather(bool startEvent)
{
if (Weather* weather = WeatherMgr::FindWeather(me->GetZoneId()))
{
if (startEvent)
weather->SetWeather(WEATHER_TYPE_STORM, 0.25f);
else
weather->SetWeather(WEATHER_TYPE_RAIN, 0.0f);
}
else if (Weather* weather = WeatherMgr::AddWeather(me->GetZoneId()))
Weather* weather = me->GetMap()->GetOrGenerateZoneDefaultWeather(me->GetZoneId());
if (weather)
{
if (startEvent)
weather->SetWeather(WEATHER_TYPE_STORM, 0.25f);
@@ -956,14 +950,8 @@ struct npc_pallid_horror : public ScriptedAI
void UpdateWeather(bool startEvent)
{
if (Weather* weather = WeatherMgr::FindWeather(me->GetZoneId()))
{
if (startEvent)
weather->SetWeather(WEATHER_TYPE_STORM, 0.25f);
else
weather->SetWeather(WEATHER_TYPE_RAIN, 0.0f);
}
else if (Weather* weather = WeatherMgr::AddWeather(me->GetZoneId()))
Weather* weather = me->GetMap()->GetOrGenerateZoneDefaultWeather(me->GetZoneId());
if (weather)
{
if (startEvent)
weather->SetWeather(WEATHER_TYPE_STORM, 0.25f);