Core/Maps: Allow multi-threaded updates for all instances of a map, should increase performance

This commit is contained in:
Shocker
2011-06-28 23:19:54 +03:00
parent 6a59d7ddc1
commit 9e58c6e753
2 changed files with 6 additions and 1 deletions

View File

@@ -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;
}
}

View File

@@ -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