Core/WeatherMgr: singleton converted to namespace with free functions. Note how RAII saves your life and removes the need in explicit delete :)

This commit is contained in:
Spp
2011-09-28 11:38:56 +02:00
parent cc06c41887
commit b93067350c
5 changed files with 52 additions and 70 deletions
+2 -2
View File
@@ -7426,12 +7426,12 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
if (sWorld->getBoolConfig(CONFIG_WEATHER))
{
Weather* wth = sWeatherMgr->FindWeather(zone->ID);
Weather* wth = WeatherMgr::FindWeather(zone->ID);
if (wth)
wth->SendWeatherUpdateToPlayer(this);
else
{
if (!sWeatherMgr->AddWeather(zone->ID))
if (!WeatherMgr::AddWeather(zone->ID))
{
// send fine weather packet to remove old zone's weather
Weather::SendFineWeatherUpdateToPlayer(this);