diff options
| author | Tartalo <none@none> | 2010-06-26 13:32:24 +0200 |
|---|---|---|
| committer | Tartalo <none@none> | 2010-06-26 13:32:24 +0200 |
| commit | 26da69a5444a15e5c1f8b1b57316ef846af969d4 (patch) | |
| tree | 242cadb1a38759dfb8ab5a04480b773d4c6b40ca /src/server/game/Groups/Group.cpp | |
| parent | 23ec7faf73481cd4c279b7c0a02e488dcba1e422 (diff) | |
Fix some deprecated checks on MapManager::CanPlayerEnter()
--HG--
branch : trunk
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 |
