aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/MapInstanced.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Maps/MapInstanced.cpp')
-rwxr-xr-xsrc/server/game/Maps/MapInstanced.cpp12
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
{