From 89a33bbf612fcd0d5cea8e1fc5deff87e53aa67e Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 13 Dec 2010 21:31:55 +0100 Subject: 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 --- src/server/game/Server/Protocol/Handlers/LFGHandler.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/server/game/Server/Protocol') diff --git a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp index afaeac66d09..e0a58aa029d 100755 --- a/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/LFGHandler.cpp @@ -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) -- cgit v1.2.3