aboutsummaryrefslogtreecommitdiff
path: root/src/game/MapInstanced.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/MapInstanced.cpp')
-rw-r--r--src/game/MapInstanced.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/game/MapInstanced.cpp b/src/game/MapInstanced.cpp
index 2ff105c2f9d..a1f2ddc39be 100644
--- a/src/game/MapInstanced.cpp
+++ b/src/game/MapInstanced.cpp
@@ -141,7 +141,17 @@ Map* MapInstanced::GetInstance(const WorldObject* obj)
uint32 NewInstanceId = 0; // instanceId of the resulting map
Player* player = (Player*)obj;
- // TODO: battlegrounds and arenas
+ if(IsBattleGroundOrArena())
+ {
+ // instantiate or find existing bg map for player
+ // the instance id is set in battlegroundid
+ NewInstanceId = player->GetBattleGroundId();
+ assert(NewInstanceId);
+ map = _FindMap(NewInstanceId);
+ if(!map)
+ map = CreateBattleGround(NewInstanceId);
+ return map;
+ }
InstancePlayerBind *pBind = player->GetBoundInstance(GetId(), player->GetDifficulty());
InstanceSave *pSave = pBind ? pBind->save : NULL;