refactor(Core/WorldState): Initial addition of world state definition file. (#21875)

Many world states had their enums from script's header and hardcoded values to their respective header file (WorldStateDefines.h)
Co-authored-by: Jelle Meeus <sogladev@gmail.com>
This commit is contained in:
Benjamin Jackson
2025-04-26 14:31:30 -04:00
committed by GitHub
parent d23e61b721
commit da55f05cfc
73 changed files with 1828 additions and 1789 deletions

View File

@@ -47,6 +47,7 @@
#include "SharedDefines.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldStateDefines.h"
#include <unordered_map>
bool BattlegroundTemplate::IsArena() const
@@ -182,7 +183,7 @@ void BattlegroundMgr::Update(uint32 diff)
{
sArenaTeamMgr->DistributeArenaPoints();
m_NextAutoDistributionTime = GameTime::GetGameTime() + Seconds(DAY * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS));
sWorld->setWorldState(WS_ARENA_DISTRIBUTION_TIME, m_NextAutoDistributionTime.count());
sWorld->setWorldState(WORLD_STATE_CUSTOM_ARENA_DISTRIBUTION_TIME, m_NextAutoDistributionTime.count());
}
m_AutoDistributionTimeChecker = 600000; // 10 minutes check
}
@@ -561,7 +562,7 @@ void BattlegroundMgr::InitAutomaticArenaPointDistribution()
if (!sWorld->getBoolConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS))
return;
Seconds wstime = Seconds(sWorld->getWorldState(WS_ARENA_DISTRIBUTION_TIME));
Seconds wstime = Seconds(sWorld->getWorldState(WORLD_STATE_CUSTOM_ARENA_DISTRIBUTION_TIME));
Seconds curtime = GameTime::GetGameTime();
LOG_INFO("server.loading", "Initializing Automatic Arena Point Distribution");