diff options
Diffstat (limited to 'src/server/game/Maps/MapInstanced.cpp')
-rwxr-xr-x | src/server/game/Maps/MapInstanced.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index bbade4c9dc3..a56a193ba64 100755 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -110,7 +110,7 @@ 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::CreateInstanceForPlayer(const uint32 mapId, Player* player) { if (GetId() != mapId || !player) return NULL; @@ -124,7 +124,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player* player) // the instance id is set in battlegroundid NewInstanceId = player->GetBattlegroundId(); if (!NewInstanceId) return NULL; - map = _FindMap(NewInstanceId); + map = FindInstanceMap(NewInstanceId); if (!map) map = CreateBattleground(NewInstanceId, player->GetBattleground()); } @@ -151,7 +151,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player* player) { // solo/perm/group NewInstanceId = pSave->GetInstanceId(); - map = _FindMap(NewInstanceId); + map = FindInstanceMap(NewInstanceId); // it is possible that the save exists but the map doesn't if (!map) map = CreateInstance(NewInstanceId, pSave, pSave->GetDifficulty()); @@ -163,7 +163,11 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player* player) NewInstanceId = sMapMgr->GenerateInstanceId(); Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(IsRaid()) : player->GetDifficulty(IsRaid()); - map = CreateInstance(NewInstanceId, NULL, diff); + //Seems it is now possible, but I do not know if it should be allowed + //ASSERT(!FindInstanceMap(NewInstanceId)); + map = FindInstanceMap(NewInstanceId); + if (!map) + map = CreateInstance(NewInstanceId, NULL, diff); } } |