diff options
Diffstat (limited to 'src/server/game/Groups/Group.cpp')
| -rw-r--r-- | src/server/game/Groups/Group.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 2977515959b..84c9b7b81d4 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1760,34 +1760,39 @@ InstanceGroupBind* Group::GetBoundInstance(Player* player) { uint32 mapid = player->GetMapId(); MapEntry const* mapEntry = sMapStore.LookupEntry(mapid); - if (!mapEntry) - return NULL; + GetBoundInstance(mapEntry); +} - Difficulty difficulty = player->GetDifficulty(mapEntry->IsRaid()); +InstanceGroupBind* Group::GetBoundInstance(Map* aMap) +{ + // Currently spawn numbering not different from map difficulty + Difficulty difficulty = GetDifficulty(aMap->IsRaid()); // some instances only have one difficulty - MapDifficulty const* mapDiff = GetMapDifficultyData(mapid,difficulty); + MapDifficulty const* mapDiff = GetMapDifficultyData(aMap->GetId(),difficulty); if (!mapDiff) - difficulty = DUNGEON_DIFFICULTY_NORMAL; + return NULL; - BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapid); + BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(aMap->GetId()); if (itr != m_boundInstances[difficulty].end()) return &itr->second; else return NULL; } -InstanceGroupBind* Group::GetBoundInstance(Map* aMap) +InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry) { - // Currently spawn numbering not different from map difficulty - Difficulty difficulty = GetDifficulty(aMap->IsRaid()); - + if (!mapEntry) + return NULL; + + Difficulty difficulty = GetDifficulty(mapEntry->IsRaid()); + // some instances only have one difficulty - MapDifficulty const* mapDiff = GetMapDifficultyData(aMap->GetId(),difficulty); + MapDifficulty const* mapDiff = GetMapDifficultyData(mapEntry->MapID,difficulty); if (!mapDiff) - return NULL; - - BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(aMap->GetId()); + difficulty = DUNGEON_DIFFICULTY_NORMAL; + + BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapEntry->MapID); if (itr != m_boundInstances[difficulty].end()) return &itr->second; else |
