[8031] Move player update code to Map::Update. Author: Ambal
--HG-- branch : trunk
This commit is contained in:
@@ -649,6 +649,15 @@ void Map::RemoveUnitFromNotify(int32 slot)
|
||||
|
||||
void Map::Update(const uint32 &t_diff)
|
||||
{
|
||||
/// update players at tick
|
||||
for(m_mapRefIter = m_mapRefManager.begin(); m_mapRefIter != m_mapRefManager.end(); ++m_mapRefIter)
|
||||
{
|
||||
Player* plr = m_mapRefIter->getSource();
|
||||
if(plr && plr->IsInWorld())
|
||||
plr->Update(t_diff);
|
||||
}
|
||||
|
||||
/// update active cells around players and active objects
|
||||
resetMarkedCells();
|
||||
|
||||
Trinity::ObjectUpdater updater(t_diff);
|
||||
|
||||
@@ -251,11 +251,6 @@ MapManager::Update(uint32 diff)
|
||||
if( !i_timer.Passed() )
|
||||
return;
|
||||
|
||||
sWorld.RecordTimeDiff(NULL);
|
||||
ObjectAccessor::Instance().UpdatePlayers(i_timer.GetCurrent());
|
||||
sWorld.RecordTimeDiff("UpdatePlayers");
|
||||
|
||||
|
||||
for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
{
|
||||
checkAndCorrectGridStatesArray(); // debugging code, should be deleted some day
|
||||
|
||||
@@ -391,15 +391,6 @@ ObjectAccessor::Update(uint32 diff)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ObjectAccessor::UpdatePlayers(uint32 diff)
|
||||
{
|
||||
HashMapHolder<Player>::MapType& playerMap = HashMapHolder<Player>::GetContainer();
|
||||
for(HashMapHolder<Player>::MapType::iterator iter = playerMap.begin(); iter != playerMap.end(); ++iter)
|
||||
if(iter->second->IsInWorld())
|
||||
iter->second->Update(diff);
|
||||
}
|
||||
|
||||
void
|
||||
ObjectAccessor::WorldObjectChangeAccumulator::Visit(PlayerMapType &m)
|
||||
{
|
||||
|
||||
@@ -201,7 +201,6 @@ class MANGOS_DLL_DECL ObjectAccessor : public MaNGOS::Singleton<ObjectAccessor,
|
||||
}
|
||||
|
||||
void Update(uint32 diff);
|
||||
void UpdatePlayers(uint32 diff);
|
||||
|
||||
Corpse* GetCorpseForPlayerGUID(uint64 guid);
|
||||
void RemoveCorpse(Corpse *corpse);
|
||||
|
||||
Reference in New Issue
Block a user