aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGooyeth <migmadmu@hotmail.com>2018-04-24 08:05:07 -0600
committerjackpoz <giacomopoz@gmail.com>2018-04-24 16:05:07 +0200
commit59f80f555c2b7608ee2457e8f4a93d0418022a1b (patch)
treef4033ac99eba40bff7d4ac8a1ff3208799c6ddbd /src
parent71188062314ee94402d9d3e228fd5b46e8865b18 (diff)
Core/Battleground: Fix arena distribution timer where it is less than the current unix time. (#21859)
* Core/Battleground: Fix arena distribution timer where it is less than the current unix time. * fix bracket * fix when the timer starts for the first time. * m_NextAutoDistributionTime instead of GetGameTime.
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Battlegrounds/BattlegroundMgr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index fe0ab0c4f2f..92136e4c27e 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -171,7 +171,9 @@ void BattlegroundMgr::Update(uint32 diff)
if (GameTime::GetGameTime() > m_NextAutoDistributionTime)
{
sArenaTeamMgr->DistributeArenaPoints();
- m_NextAutoDistributionTime = sWorld->getWorldState(WS_ARENA_DISTRIBUTION_TIME) + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
+
+ time_t arenaDistributionTime = sWorld->getWorldState(WS_ARENA_DISTRIBUTION_TIME) == 0 ? m_NextAutoDistributionTime : time_t(sWorld->getWorldState(WS_ARENA_DISTRIBUTION_TIME));
+ m_NextAutoDistributionTime = arenaDistributionTime + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
sWorld->setWorldState(WS_ARENA_DISTRIBUTION_TIME, uint64(m_NextAutoDistributionTime));
}
m_AutoDistributionTimeChecker = 600000; // check 10 minutes