diff options
author | Shocker <shocker@freakz.ro> | 2012-01-04 13:18:05 -0800 |
---|---|---|
committer | Shocker <shocker@freakz.ro> | 2012-01-04 13:18:05 -0800 |
commit | b1129499a2b111aae7a3d9e75a06211c5f4f84e3 (patch) | |
tree | 051c2474484f522d9e975f04cb6d7c0101f34b32 /src/server/game/Maps/MapInstanced.cpp | |
parent | 19e9a09c2a9ad4316e09086e9f4d39f6a335bd6b (diff) | |
parent | 2a38902d2edcf669bcfbda7a0fca868bd3371ba4 (diff) |
Merge pull request #4587 from wilds/fix_reenter_bg
Core/Battleground: Fix re-entering battlegrounds after disconnect
Closes #90
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 { |