Merge branch 'master' into 303

This commit is contained in:
tomrus88 2008-11-27 07:19:12 +03:00
commit ed77adf964
3 changed files with 13 additions and 4 deletions

View file

@ -573,12 +573,21 @@ void Map::Update(const uint32 &t_diff)
// for pets
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())
continue;
if(plr->GetMapId() != GetId())
continue;
if(plr->GetInstanceId() != GetInstanceId())
continue;
CellPair standing_cell(MaNGOS::ComputeCellPair(plr->GetPositionX(), plr->GetPositionY()));
// Check for correctness of standing_cell, it also avoids problems with update_cell