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.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/game/MapInstanced.cpp b/src/game/MapInstanced.cpp
index 89be57275bb..dfb673955c3 100644
--- a/src/game/MapInstanced.cpp
+++ b/src/game/MapInstanced.cpp
@@ -116,27 +116,16 @@ void MapInstanced::UnloadAll()
- create the instance if it's not created already
- the player is not actually added to the instance (only in InstanceMap::Add)
*/
-Map* MapInstanced::CreateInstance(const uint32 mapId, Player * player)
+Map* MapInstanced::CreateInstance(const uint32 mapId, Player * player, uint32 instanceId)
{
- uint32 instanceId = player->GetInstanceId();
-
if(instanceId)
if(Map *map = _FindMap(instanceId))
return map;
if(IsBattleGroundOrArena())
{
- instanceId = player->GetBattleGroundId();
-
- if(instanceId)
- {
- if(Map *map = _FindMap(instanceId))
- return map;
- else
- return CreateBattleGround(instanceId);
- }
- else
- return NULL;
+ assert(player->GetBattleGroundId());
+ return CreateBattleGround(player->GetBattleGroundId());
}
if(InstanceSave *pSave = player->GetInstanceSave(GetId()))