mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[6850] Use the HashMapHolder instead of MapReference in Map::Update for now (the refs can get invalidated during the loop).
This commit is contained in:
parent
bdf7fb8394
commit
ce387d8535
2 changed files with 12 additions and 3 deletions
|
|
@ -573,12 +573,21 @@ void Map::Update(const uint32 &t_diff)
|
||||||
// for pets
|
// for pets
|
||||||
TypeContainerVisitor<MaNGOS::ObjectUpdater, WorldTypeMapContainer > world_object_update(updater);
|
TypeContainerVisitor<MaNGOS::ObjectUpdater, WorldTypeMapContainer > world_object_update(updater);
|
||||||
|
|
||||||
for(MapRefManager::iterator iter = m_mapRefManager.begin(); iter != m_mapRefManager.end(); ++iter)
|
//TODO: Player guard
|
||||||
|
HashMapHolder<Player>::MapType& playerMap = HashMapHolder<Player>::GetContainer();
|
||||||
|
for(HashMapHolder<Player>::MapType::iterator iter = playerMap.begin(); iter != playerMap.end(); ++iter)
|
||||||
{
|
{
|
||||||
Player* plr = iter->getSource();
|
Player* plr = iter->second;
|
||||||
|
|
||||||
if(!plr->IsInWorld())
|
if(!plr->IsInWorld())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if(plr->GetMapId() != GetId())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(plr->GetInstanceId() != GetInstanceId())
|
||||||
|
continue;
|
||||||
|
|
||||||
CellPair standing_cell(MaNGOS::ComputeCellPair(plr->GetPositionX(), plr->GetPositionY()));
|
CellPair standing_cell(MaNGOS::ComputeCellPair(plr->GetPositionX(), plr->GetPositionY()));
|
||||||
|
|
||||||
// Check for correctness of standing_cell, it also avoids problems with update_cell
|
// Check for correctness of standing_cell, it also avoids problems with update_cell
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "6849"
|
#define REVISION_NR "6850"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue