diff options
author | Kaelima <kaelima@live.se> | 2011-08-04 11:20:37 -0700 |
---|---|---|
committer | Kaelima <kaelima@live.se> | 2011-08-04 11:20:37 -0700 |
commit | 3a32ded09b4740ac1f7c33dcdb444901e5be87e4 (patch) | |
tree | 9de3be69c383eaecd7a6fe61c9054cdb7f542510 /src | |
parent | d0de7976dc6273a7e0a9b005707e4d7c04ff139c (diff) | |
parent | 3fbb657e3bf217f4ebb60992e601ed621720249f (diff) |
Merge pull request #2501 from LihO/master
Fix logic in dungeon selection and a crash fix in Map::Update.
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/DungeonFinding/LFGMgr.cpp | 3 | ||||
-rwxr-xr-x | src/server/game/Maps/Map.cpp | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 2fc6e84da4e..c2da032ccdf 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -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 diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index e3ab09ed426..4cde2913160 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -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); |