diff options
Diffstat (limited to 'src/server/game/Maps/MapInstanced.cpp')
-rwxr-xr-x | src/server/game/Maps/MapInstanced.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index a56a193ba64..fbe609bee23 100755 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/> + * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/> * * This program is free software; you can redistribute it and/or modify it @@ -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 { |