mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[8031] Move player update code to Map::Update.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
7024862b82
commit
2b69a914cf
5 changed files with 10 additions and 13 deletions
|
|
@ -550,6 +550,15 @@ bool Map::loaded(const GridPair &p) const
|
|||
|
||||
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();
|
||||
|
||||
MaNGOS::ObjectUpdater updater(t_diff);
|
||||
|
|
|
|||
|
|
@ -250,8 +250,6 @@ MapManager::Update(uint32 diff)
|
|||
if( !i_timer.Passed() )
|
||||
return;
|
||||
|
||||
ObjectAccessor::Instance().UpdatePlayers(i_timer.GetCurrent());
|
||||
|
||||
for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
{
|
||||
checkAndCorrectGridStatesArray(); // debugging code, should be deleted some day
|
||||
|
|
|
|||
|
|
@ -405,15 +405,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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -186,7 +186,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);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8030"
|
||||
#define REVISION_NR "8031"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue