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
+2 -18
View File
@@ -6093,25 +6093,9 @@ namespace Game.Spells
return;
if (apply)
{
WeatherPkt weather = new WeatherPkt((WeatherState)GetMiscValue(), 1.0f);
target.SendPacket(weather);
}
target.SendPacket(new WeatherPkt((WeatherState)GetMiscValue(), 1.0f));
else
{
// send weather for current zone
Weather weather = Global.WeatherMgr.FindWeather(target.GetZoneId());
if (weather != null)
weather.SendWeatherUpdateToPlayer(target);
else
{
if (Global.WeatherMgr.AddWeather(target.GetZoneId()) == null)
{
// send fine weather packet to remove old weather
Global.WeatherMgr.SendFineWeatherUpdateToPlayer(target);
}
}
}
target.GetMap().SendZoneWeather(target.GetZoneId(), target);
}
[AuraEffectHandler(AuraType.EnableAltPower)]