feat(Core/Grids): Implement visibility notifier (#15919)

* Cherry-picked from TrinityCore (unable to find author)
This commit is contained in:
AG
2023-09-28 22:28:28 +02:00
committed by GitHub
parent 29af6cc886
commit 2779833768
33 changed files with 1254 additions and 510 deletions

View File

@@ -36,6 +36,7 @@
MapMgr::MapMgr()
{
i_gridCleanUpDelay = sWorld->getIntConfig(CONFIG_INTERVAL_GRIDCLEAN);
i_timer[3].SetInterval(sWorld->getIntConfig(CONFIG_INTERVAL_MAPUPDATE));
mapUpdateStep = 0;
_nextInstanceId = 0;
@@ -53,6 +54,8 @@ MapMgr* MapMgr::instance()
void MapMgr::Initialize()
{
Map::InitStateMachine();
int num_threads(sWorld->getIntConfig(CONFIG_NUMTHREADS));
// Start mtmaps if needed
@@ -81,10 +84,10 @@ Map* MapMgr::CreateBaseMap(uint32 id)
ASSERT(entry);
if (entry->Instanceable())
map = new MapInstanced(id);
map = new MapInstanced(id, std::chrono::seconds(i_gridCleanUpDelay));
else
{
map = new Map(id, 0, REGULAR_DIFFICULTY);
map = new Map(id, std::chrono::seconds(i_gridCleanUpDelay), 0, REGULAR_DIFFICULTY);
map->LoadRespawnTimes();
map->LoadCorpseData();
}
@@ -333,6 +336,8 @@ void MapMgr::UnloadAll()
if (m_updater.activated())
m_updater.deactivate();
Map::DeleteStateMachine();
}
void MapMgr::GetNumInstances(uint32& dungeons, uint32& battlegrounds, uint32& arenas)