diff options
author | n0n4m3 <none@none> | 2009-12-23 08:04:10 +0100 |
---|---|---|
committer | n0n4m3 <none@none> | 2009-12-23 08:04:10 +0100 |
commit | 3fe0bc52541d8cdf4fa992d9b8b3101cde5848f0 (patch) | |
tree | be5871dc19f69f4555d9ffa7c57e5d964b8e60e0 /src/game/BattleGroundMgr.cpp | |
parent | 7ea2510980d4b1c96f0341e9c8b9d5784862dc72 (diff) |
Replaced time(NULL) on sGameTime.GetGameTime() this is used for better performance.
Original Timer.h divided into 2 parts. Shared project has no need to know about GameTime Singleton.
2 Identical structures with different types are now replaced with one generic templated structure and 2 typedefs.
--HG--
branch : trunk
Diffstat (limited to 'src/game/BattleGroundMgr.cpp')
-rw-r--r-- | src/game/BattleGroundMgr.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGroundMgr.cpp index 0853148362f..249243a78f1 100644 --- a/src/game/BattleGroundMgr.cpp +++ b/src/game/BattleGroundMgr.cpp @@ -47,6 +47,7 @@ #include "GameEventMgr.h" #include "ProgressBar.h" #include "SharedDefines.h" +#include "TimeMgr.h" INSTANTIATE_SINGLETON_1( BattleGroundMgr ); @@ -1224,10 +1225,10 @@ void BattleGroundMgr::Update(uint32 diff) { if (m_AutoDistributionTimeChecker < diff) { - if(time(NULL) > m_NextAutoDistributionTime) + if(sGameTime.GetGameTime() > m_NextAutoDistributionTime) { DistributeArenaPoints(); - m_NextAutoDistributionTime = time(NULL) + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS); + m_NextAutoDistributionTime = sGameTime.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS); CharacterDatabase.PExecute("UPDATE saved_variables SET NextArenaPointDistributionTime = '"UI64FMTD"'", m_NextAutoDistributionTime); } m_AutoDistributionTimeChecker = 600000; // check 10 minutes @@ -1805,7 +1806,7 @@ void BattleGroundMgr::InitAutomaticArenaPointDistribution() if (!result) { sLog.outDebug("Battleground: Next arena point distribution time not found in SavedVariables, reseting it now."); - m_NextAutoDistributionTime = time(NULL) + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS); + m_NextAutoDistributionTime = sGameTime.GetGameTime() + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld.getConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS); CharacterDatabase.PExecute("INSERT INTO saved_variables (NextArenaPointDistributionTime) VALUES ('"UI64FMTD"')", m_NextAutoDistributionTime); } else |