mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 17:27:36 +01:00
Merge pull request #2501 from LihO/master
Fix logic in dungeon selection and a crash fix in Map::Update.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user