From 2a38902d2edcf669bcfbda7a0fca868bd3371ba4 Mon Sep 17 00:00:00 2001 From: Wilds Date: Wed, 4 Jan 2012 11:52:13 +0100 Subject: Core/Battleground: fix re-enter into battleground after disconnect --- src/server/game/Maps/MapInstanced.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/server/game/Maps/MapInstanced.cpp') 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 { -- cgit v1.2.3