mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core: Removed more operator workarounds for ACE_Singleton (missed previously because of inconsistent naming)
--HG-- branch : trunk
This commit is contained in:
@@ -33,11 +33,11 @@
|
||||
Weather::Weather(uint32 zone, WeatherData const* weatherChances)
|
||||
: m_zone(zone), m_weatherChances(weatherChances)
|
||||
{
|
||||
m_timer.SetInterval(sWorld.getIntConfig(CONFIG_INTERVAL_CHANGEWEATHER));
|
||||
m_timer.SetInterval(sWorld->getIntConfig(CONFIG_INTERVAL_CHANGEWEATHER));
|
||||
m_type = WEATHER_TYPE_FINE;
|
||||
m_grade = 0;
|
||||
|
||||
sLog.outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS)));
|
||||
sLog->outDetail("WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS)));
|
||||
}
|
||||
|
||||
/// Launch a weather update
|
||||
@@ -91,13 +91,13 @@ bool Weather::ReGenerate()
|
||||
|
||||
//78 days between January 1st and March 20nd; 365/4=91 days by season
|
||||
// season source http://aa.usno.navy.mil/data/docs/EarthSeasons.html
|
||||
time_t gtime = sWorld.GetGameTime();
|
||||
time_t gtime = sWorld->GetGameTime();
|
||||
struct tm * ltime = localtime(>ime);
|
||||
uint32 season = ((ltime->tm_yday - 78 + 365)/91)%4;
|
||||
|
||||
static char const* seasonName[WEATHER_SEASONS] = { "spring", "summer", "fall", "winter" };
|
||||
|
||||
sLog.outDebug("Generating a change in %s weather for zone %u.", seasonName[season], m_zone);
|
||||
sLog->outDebug("Generating a change in %s weather for zone %u.", seasonName[season], m_zone);
|
||||
|
||||
if ((u < 60) && (m_grade < 0.33333334f)) // Get fair
|
||||
{
|
||||
@@ -208,7 +208,7 @@ void Weather::SendFineWeatherUpdateToPlayer(Player *player)
|
||||
/// Send the new weather to all players in the zone
|
||||
bool Weather::UpdateWeather()
|
||||
{
|
||||
Player* player = sWorld.FindPlayerInZone(m_zone);
|
||||
Player* player = sWorld->FindPlayerInZone(m_zone);
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
@@ -266,7 +266,7 @@ bool Weather::UpdateWeather()
|
||||
wthstr = "fine";
|
||||
break;
|
||||
}
|
||||
sLog.outDetail("Change the weather of zone %u to %s.", m_zone, wthstr);
|
||||
sLog->outDetail("Change the weather of zone %u to %s.", m_zone, wthstr);
|
||||
|
||||
sScriptMgr->OnWeatherChange(this, state, m_grade);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user