[10687] UInt32 timer class copies instead using time_t timers for mstime cases.

Also cleanup weather update code and some random code cleanups.
This commit is contained in:
VladimirMangos 2010-11-06 21:54:05 +03:00
parent 478bf3b367
commit 464908f453
15 changed files with 87 additions and 67 deletions

View file

@ -35,15 +35,13 @@ Weather::Weather(uint32 zone, WeatherZoneChances const* weatherChances) : m_zone
m_type = WEATHER_TYPE_FINE;
m_grade = 0;
DETAIL_FILTER_LOG(LOG_FILTER_WEATHER, "WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (uint32)(m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS)) );
DETAIL_FILTER_LOG(LOG_FILTER_WEATHER, "WORLD: Starting weather system for zone %u (change every %u minutes).", m_zone, (m_timer.GetInterval() / (MINUTE*IN_MILLISECONDS)) );
}
/// Launch a weather update
bool Weather::Update(time_t diff)
{
if (m_timer.GetCurrent()>=0)
m_timer.Update(diff);
else m_timer.SetCurrent(0);
m_timer.Update(diff);
///- If the timer has passed, ReGenerate the weather
if(m_timer.Passed())