diff options
author | Machiavelli <none@none> | 2010-09-25 14:47:24 +0200 |
---|---|---|
committer | Machiavelli <none@none> | 2010-09-25 14:47:24 +0200 |
commit | 311ae331ad3b0135a8bcef9457dc28ec030e08d3 (patch) | |
tree | 340d1ab0a4c72a9f1382c90b9999a1f27b0daa26 /src/server/game/Instances/InstanceSaveMgr.cpp | |
parent | 24e24020d1ebb7b56e971922f754b68942d9a93e (diff) |
Core/InstanceSaveMgr: Statically define ResetTimeDelay as class member instead of redefining it in different functions
--HG--
branch : trunk
Diffstat (limited to 'src/server/game/Instances/InstanceSaveMgr.cpp')
-rw-r--r-- | src/server/game/Instances/InstanceSaveMgr.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index b9b988f7a3d..50d46ed4dfb 100644 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -40,6 +40,7 @@ #include "InstanceScript.h" #include "ProgressBar.h" +uint16 InstanceSaveManager::ResetTimeDelay[] = {3600, 900, 300, 60}; InstanceSaveManager::~InstanceSaveManager() { @@ -516,17 +517,16 @@ void InstanceSaveManager::LoadResetTimes() // schedule the global reset/warning uint8 type = 1; - static int tim[4] = {3600, 900, 300, 60}; for (; type < 4; type++) - if (t - tim[type-1] > now) + if (t - ResetTimeDelay[type-1] > now) break; - ScheduleReset(true, t - tim[type-1], InstResetEvent(type, mapid, difficulty, 0)); + ScheduleReset(true, t - ResetTimeDelay[type-1], InstResetEvent(type, mapid, difficulty, 0)); for (ResetTimeMapDiffInstances::const_iterator in_itr = mapDiffResetInstances.lower_bound(map_diff_pair); in_itr != mapDiffResetInstances.upper_bound(map_diff_pair); ++in_itr) { - ScheduleReset(true, t - tim[type-1], InstResetEvent(type, mapid, difficulty, in_itr->second)); + ScheduleReset(true, t - ResetTimeDelay[type-1], InstResetEvent(type, mapid, difficulty, in_itr->second)); } } } @@ -574,8 +574,7 @@ void InstanceSaveManager::Update() { // schedule the next warning/reset event.type++; - static int tim[4] = {3600, 900, 300, 60}; - ScheduleReset(true, resetTime - tim[event.type-1], event); + ScheduleReset(true, resetTime - ResetTimeDelay[event.type-1], event); } m_resetTimeQueue.erase(m_resetTimeQueue.begin()); } |