diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Groups/Group.cpp | 33 | ||||
| -rw-r--r-- | src/server/game/Groups/Group.h | 1 | ||||
| -rw-r--r-- | src/server/game/Maps/MapManager.cpp | 4 | 
3 files changed, 22 insertions, 16 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 diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index 8ec44c53b02..2b93b7b1d6e 100644 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -358,6 +358,7 @@ class Group          void UnbindInstance(uint32 mapid, uint8 difficulty, bool unload = false);          InstanceGroupBind* GetBoundInstance(Player* player);          InstanceGroupBind* GetBoundInstance(Map* aMap); +        InstanceGroupBind* GetBoundInstance(MapEntry const* mapEntry);          BoundInstancesMap& GetBoundInstances(Difficulty difficulty) { return m_boundInstances[difficulty]; }          // FG: evil hacks diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index 46b604388c5..47032bd6215 100644 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -228,13 +228,13 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)      //Get instance where player's group is bound & its map      if (pGroup)      { -        InstanceGroupBind* boundedInstance = pGroup->GetBoundInstance(player); +        InstanceGroupBind* boundedInstance = pGroup->GetBoundInstance(entry);          if (boundedInstance && boundedInstance->save)          {              if (Map *boundedMap = sMapMgr.FindMap(mapid,boundedInstance->save->GetInstanceId()))              {                  // Player permanently bounded to different instance than groups one -                InstancePlayerBind* playerBoundedInstance = player->GetBoundInstance(mapid, player->GetDungeonDifficulty()); +                InstancePlayerBind* playerBoundedInstance = player->GetBoundInstance(mapid, player->GetDifficulty(entry->IsRaid()));                  if (playerBoundedInstance && playerBoundedInstance->perm && playerBoundedInstance->save &&                      boundedInstance->save->GetInstanceId() != playerBoundedInstance->save->GetInstanceId())                  {  | 
