mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Maps: Allow multi-threaded updates for all instances of a map, should increase performance
This commit is contained in:
@@ -64,7 +64,10 @@ void MapInstanced::Update(const uint32& t)
|
||||
else
|
||||
{
|
||||
// update only here, because it may schedule some bad things before delete
|
||||
i->second->Update(t);
|
||||
if (sMapMgr->GetMapUpdater()->activated())
|
||||
sMapMgr->GetMapUpdater()->schedule_update(*i->second, t);
|
||||
else
|
||||
i->second->Update(t);
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,6 +148,8 @@ class MapManager
|
||||
uint32 GetNextInstanceId() { return _nextInstanceId; };
|
||||
void SetNextInstanceId(uint32 nextInstanceId) { _nextInstanceId = nextInstanceId; };
|
||||
|
||||
MapUpdater * GetMapUpdater() { return &m_updater; }
|
||||
|
||||
private:
|
||||
// debugging code, should be deleted some day
|
||||
void checkAndCorrectGridStatesArray(); // just for debugging to find some memory overwrites
|
||||
|
||||
Reference in New Issue
Block a user