Core/Dungeon Finder: Fix a crash in Join when there are no dungeons available for that group (And probably other random crashes that appear when having DF enabled)

Core/Dungeon Finder: Tab2spaces + remove trailing spaces in LFG* files.

Notes to self:
- assign NULL to a pointer parameter will not change the pointer value outside the scope of the function
- deleting a const_iterator can lead to mem corruption

--HG--
branch : trunk
This commit is contained in:
Spp
2010-12-13 21:31:55 +01:00
parent 865f35a637
commit 89a33bbf61
4 changed files with 41 additions and 38 deletions

View File

@@ -31,16 +31,13 @@ void BuildPlayerLockDungeonBlock(WorldPacket &data, LfgLockStatusSet* lockSet)
data << uint8(0);
return;
}
data << uint32(lockSet->size()); // Size of lock dungeons
for (LfgLockStatusSet::iterator it = lockSet->begin(); it != lockSet->end(); ++it)
for (LfgLockStatusSet::const_iterator it = lockSet->begin(); it != lockSet->end(); ++it)
{
data << uint32((*it)->dungeon); // Dungeon entry + type
data << uint32((*it)->lockstatus); // Lock status
delete (*it);
}
delete lockSet;
lockSet = NULL;
}
void BuildPartyLockDungeonBlock(WorldPacket &data, LfgLockStatusMap* lockMap)
@@ -57,8 +54,6 @@ void BuildPartyLockDungeonBlock(WorldPacket &data, LfgLockStatusMap* lockMap)
data << uint64(MAKE_NEW_GUID(it->first, 0, HIGHGUID_PLAYER)); // Player guid
BuildPlayerLockDungeonBlock(data, it->second);
}
delete lockMap;
lockMap = NULL;
}
void WorldSession::HandleLfgJoinOpcode(WorldPacket &recv_data)