diff options
author | Wilds <ivoselva@gmail.com> | 2012-01-04 11:52:13 +0100 |
---|---|---|
committer | Wilds <ivoselva@gmail.com> | 2012-01-04 11:52:13 +0100 |
commit | 2a38902d2edcf669bcfbda7a0fca868bd3371ba4 (patch) | |
tree | c6cea818e0758ed1bfeed11597ef98a10432ae2a /src/server/game/Maps/MapInstanced.cpp | |
parent | ced346076b335a02a5fc8de8e1bd1dc43ae4e838 (diff) |
Core/Battleground: fix re-enter into battleground after disconnect
Diffstat (limited to 'src/server/game/Maps/MapInstanced.cpp')
-rwxr-xr-x | src/server/game/Maps/MapInstanced.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 2dafd44b0d1..fbe609bee23 100755 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -124,9 +124,17 @@ Map* MapInstanced::CreateInstanceForPlayer(const uint32 mapId, Player* player) // the instance id is set in battlegroundid NewInstanceId = player->GetBattlegroundId(); if (!NewInstanceId) return NULL; - map = FindInstanceMap(NewInstanceId); + map = sMapMgr->FindMap(mapId, NewInstanceId); if (!map) - map = CreateBattleground(NewInstanceId, player->GetBattleground()); + { + if (Battleground* bg = player->GetBattleground()) + map = CreateBattleground(NewInstanceId, bg); + else + { + player->TeleportToBGEntryPoint(); + return NULL; + } + } } else { |