diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/MapInstanced.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/game/MapInstanced.cpp b/src/game/MapInstanced.cpp index 0ac64b8f62e..df0fca8016c 100644 --- a/src/game/MapInstanced.cpp +++ b/src/game/MapInstanced.cpp @@ -121,21 +121,25 @@ Map* MapInstanced::GetInstance(const WorldObject* obj) Player* player = (Player*)obj; uint32 instanceId = player->GetInstanceId(); + if(instanceId) + if(Map *map = _FindMap(instanceId)) + return map; + if(IsBattleGroundOrArena()) { - if(!instanceId) - instanceId = player->GetBattleGroundId(); + instanceId = player->GetBattleGroundId(); if(instanceId) - return _FindMap(instanceId); + { + if(Map *map = _FindMap(instanceId)) + return map; + else + return CreateBattleGround(instanceId); + } else return NULL; } - if(instanceId) - if(Map *map = _FindMap(instanceId)) - return map; - InstancePlayerBind *pBind = player->GetBoundInstance(GetId(), player->GetDifficulty()); InstanceSave *pSave = pBind ? pBind->save : NULL; if(!pBind || !pBind->perm) |