Merge pull request #2501 from LihO/master

Fix logic in dungeon selection and a crash fix in Map::Update.
This commit is contained in:
Kaelima
2011-08-04 11:20:37 -07:00
2 changed files with 4 additions and 3 deletions

View File

@@ -931,7 +931,8 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal)
// Select a random dungeon from the compatible list
// TODO - Select the dungeon based on group item Level, not just random
LfgDungeonSet::const_iterator itDungeon = compatibleDungeons.begin();
for (uint8 i = 0; i < urand(0, compatibleDungeons.size() - 1); ++i)
uint8 rand = urand(0, compatibleDungeons.size() - 1);
for (uint8 i = 0; i < rand; ++i)
++itDungeon;
// Create a new proposal

View File

@@ -544,7 +544,7 @@ void Map::Update(const uint32 t_diff)
{
Player* plr = m_mapRefIter->getSource();
if (!plr->IsInWorld())
if (!plr || !plr->IsInWorld())
continue;
// update players at tick
@@ -559,7 +559,7 @@ void Map::Update(const uint32 t_diff)
WorldObject* obj = *m_activeNonPlayersIter;
++m_activeNonPlayersIter;
if (!obj->IsInWorld())
if (!obj || !obj->IsInWorld())
continue;
VisitNearbyCellsOf(obj, grid_object_update, world_object_update);