aboutsummaryrefslogtreecommitdiff
path: root/src/game/MapInstanced.cpp
diff options
context:
space:
mode:
authorw12x <none@none>2008-10-05 08:48:32 -0500
committerw12x <none@none>2008-10-05 08:48:32 -0500
commit6f0c3469a63c97eef57f36f1a39fed0b281b7cc9 (patch)
tree7089d31e4493160bed067ac9da519841704b230a /src/game/MapInstanced.cpp
parent8b3fcc37c624c3ee4808d63160f563c070950cb4 (diff)
[svn] -enabled instantiated battlegrounds
-enabled arena matches -rewritten battleground queuing to support joining as group -removed queue announcements --HG-- branch : trunk
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;