Fixed weather updates to be thread safe

This commit is contained in:
hondacrx
2017-09-20 00:27:47 -04:00
parent 28e6d6870a
commit 1b9bf99d8c
6 changed files with 88 additions and 103 deletions
+3 -11
View File
@@ -175,18 +175,10 @@ namespace Game.Entities
if (zone == null)
return;
if (WorldConfig.GetBoolValue(WorldCfg.Weather) && !HasAuraType(AuraType.ForceWeather))
{
Weather weather = Global.WeatherMgr.FindWeather(newZone);
if (weather != null)
weather.SendWeatherUpdateToPlayer(this);
else if (Global.WeatherMgr.AddWeather(newZone) == null)
{
// send fine weather packet to remove old zone's weather
Global.WeatherMgr.SendFineWeatherUpdateToPlayer(this);
}
}
if (WorldConfig.GetBoolValue(WorldCfg.Weather))
GetMap().GetOrGenerateZoneDefaultWeather(newZone);
GetMap().SendZoneDynamicInfo(newZone, this);
Global.ScriptMgr.OnPlayerUpdateZone(this, newZone, newArea);