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

@@ -1289,13 +1289,9 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea, bool force)
return;
if (sWorld->getBoolConfig(CONFIG_WEATHER))
{
if (Weather* weather = WeatherMgr::FindWeather(zone->ID))
weather->SendWeatherUpdateToPlayer(this);
else if (!WeatherMgr::AddWeather(zone->ID))
// send fine weather packet to remove old zone's weather
WeatherMgr::SendFineWeatherUpdateToPlayer(this);
}
GetMap()->GetOrGenerateZoneDefaultWeather(newZone);
GetMap()->SendZoneDynamicInfo(newZone, this);
sScriptMgr->OnPlayerUpdateZone(this, newZone, newArea);