aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Groups/Group.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Groups/Group.cpp')
-rw-r--r--src/server/game/Groups/Group.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index ffa87212eb5..d70d1c824ec 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
+ * Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
@@ -2041,28 +2041,24 @@ InstanceGroupBind* Group::GetBoundInstance(Map* aMap)
{
// Currently spawn numbering not different from map difficulty
Difficulty difficulty = GetDifficulty(aMap->IsRaid());
-
- // some instances only have one difficulty
- GetDownscaledMapDifficultyData(aMap->GetId(), difficulty);
-
- BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(aMap->GetId());
- if (itr != m_boundInstances[difficulty].end())
- return &itr->second;
- else
- return NULL;
+ return GetBoundInstance(difficulty, aMap->GetId());
}
InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry)
{
- if (!mapEntry)
+ if (!mapEntry || !mapEntry->IsDungeon())
return NULL;
Difficulty difficulty = GetDifficulty(mapEntry->IsRaid());
+ return GetBoundInstance(difficulty, mapEntry->MapID);
+}
+InstanceGroupBind* Group::GetBoundInstance(Difficulty difficulty, uint32 mapId)
+{
// some instances only have one difficulty
- GetDownscaledMapDifficultyData(mapEntry->MapID, difficulty);
+ GetDownscaledMapDifficultyData(mapId, difficulty);
- BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapEntry->MapID);
+ BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapId);
if (itr != m_boundInstances[difficulty].end())
return &itr->second;
else