TrinityCore/TrinityCore — Issue #5465: flush arena points auto distribute
Author: johndays
Created: 2012-02-27 20:55:47+00:00
State: open

I think this isn't working correctly, because the server is distributing in 10 in 10 minutes.

Arena.AutoDistributePoints
Description: Automatically distribute arena points.
Default: 0 - (Disabled)
1 - (Enabled)

Arena.AutoDistributePoints = 1

Arena.AutoDistributeInterval
Description: Time (in days) how often arena points should be distributed if automatic
distribution is enabled.
Default: 7 - (Weekly)

Arena.AutoDistributeInterval = 1

I think the problem is here, in the third if, but i don't know why

if (sWorld->getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
{
if (m_AutoDistributionTimeChecker < diff)
{
if (time(NULL) > m_NextAutoDistributionTime)
{
sArenaTeamMgr->DistributeArenaPoints();
m_NextAutoDistributionTime = m_NextAutoDistributionTime + 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

}
else
m_AutoDistributionTimeChecker -= diff;
}