diff --git a/src/game/MapManager.cpp b/src/game/MapManager.cpp index fd8505a5628..9b12a063ae8 100644 --- a/src/game/MapManager.cpp +++ b/src/game/MapManager.cpp @@ -246,10 +246,10 @@ MapManager::Update(uint32 diff) return; for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter) - iter->second->Update(i_timer.GetCurrent()); + iter->second->Update((uint32)i_timer.GetCurrent()); for (TransportSet::iterator iter = m_Transports.begin(); iter != m_Transports.end(); ++iter) - (*iter)->Update(i_timer.GetCurrent()); + (*iter)->Update((uint32)i_timer.GetCurrent()); i_timer.SetCurrent(0); } diff --git a/src/game/MapManager.h b/src/game/MapManager.h index 57e07075f52..a578c2f4b46 100644 --- a/src/game/MapManager.h +++ b/src/game/MapManager.h @@ -171,7 +171,7 @@ class MANGOS_DLL_DECL MapManager : public MaNGOS::Singleton::Lock Guard; uint32 i_gridCleanUpDelay; MapMapType i_maps; - ShortIntervalTimer i_timer; + IntervalTimer i_timer; }; #define sMapMgr MapManager::Instance() diff --git a/src/game/World.cpp b/src/game/World.cpp index 0bfb13fb37c..3f8545153ea 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -1287,7 +1287,7 @@ void World::SetInitialWorldSettings() //one second is 1000 -(tested on win system) mail_timer = uint32((((localtime( &m_gameTime )->tm_hour + 20) % 24)* HOUR * IN_MILLISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval() ); //1440 - mail_timer_expires = (DAY * IN_MILLISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval(); + mail_timer_expires = uint32( (DAY * IN_MILLISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval())); DEBUG_LOG("Mail timer set to: %u, mail return is called every %u minutes", mail_timer, mail_timer_expires); ///- Initialize static helper structures @@ -1385,7 +1385,12 @@ void World::Update(uint32 diff) { ///- Update the different timers for(int i = 0; i < WUPDATE_COUNT; ++i) - m_timers[i].Update(diff); + { + if (m_timers[i].GetCurrent()>=0) + m_timers[i].Update(diff); + else + m_timers[i].SetCurrent(0); + } ///- Update the game time and check for shutdown time _UpdateGameTime(); diff --git a/src/game/World.h b/src/game/World.h index 52caa9b5ab1..b32f2dbeda9 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -620,7 +620,7 @@ class World time_t m_startTime; time_t m_gameTime; - ShortIntervalTimer m_timers[WUPDATE_COUNT]; + IntervalTimer m_timers[WUPDATE_COUNT]; uint32 mail_timer; uint32 mail_timer_expires; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 59a75ec9775..3cf2e8b5a11 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10717" + #define REVISION_NR "10718" #endif // __REVISION_NR_H__