Skip to content

Commit

Permalink
Spawn ObjectsUpdate threads only for continents. (#2646)
Browse files Browse the repository at this point in the history
  • Loading branch information
shudza authored Jun 7, 2024
1 parent 93392ef commit ae4d5f7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/game/Maps/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,14 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId)
m_persistentState->SetUsedByMapState(this);
m_weatherSystem = new WeatherSystem(this);

int numObjThreads = (int)sWorld.getConfig(CONFIG_UINT32_MAP_OBJECTSUPDATE_THREADS);
if (numObjThreads > 1)
{
m_objectThreads.reset(new ThreadPool(numObjThreads -1));
m_objectThreads->start<ThreadPool::MySQL<ThreadPool::MultiQueue>>();
}
if (IsContinent())
{
int numObjThreads = (int)sWorld.getConfig(CONFIG_UINT32_MAP_OBJECTSUPDATE_THREADS);
if (numObjThreads > 1)
{
m_objectThreads.reset(new ThreadPool(numObjThreads -1));
m_objectThreads->start<ThreadPool::MySQL<ThreadPool::MultiQueue>>();
}
m_motionThreads.reset(new ThreadPool(sWorld.getConfig(CONFIG_UINT32_CONTINENTS_MOTIONUPDATE_THREADS)));
m_visibilityThreads.reset(new ThreadPool(std::max((int)sWorld.getConfig(CONFIG_UINT32_MAP_VISIBILITYUPDATE_THREADS) -1,0)));
m_cellThreads.reset(new ThreadPool(std::max((int)sWorld.getConfig(CONFIG_UINT32_MTCELLS_THREADS) - 1, 0)));
Expand Down

0 comments on commit ae4d5f7

Please sign in to comment.