Fix some deprecated checks on MapManager::CanPlayerEnter()

--HG--
branch : trunk
This commit is contained in:
Tartalo
2010-06-26 13:32:24 +02:00
parent 23ec7faf73
commit 26da69a544
3 changed files with 23 additions and 17 deletions
+20 -15
View File
@@ -1760,21 +1760,7 @@ InstanceGroupBind* Group::GetBoundInstance(Player* player)
{
uint32 mapid = player->GetMapId();
MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
if (!mapEntry)
return NULL;
Difficulty difficulty = player->GetDifficulty(mapEntry->IsRaid());
// some instances only have one difficulty
MapDifficulty const* mapDiff = GetMapDifficultyData(mapid,difficulty);
if (!mapDiff)
difficulty = DUNGEON_DIFFICULTY_NORMAL;
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapid);
if (itr != m_boundInstances[difficulty].end())
return &itr->second;
else
return NULL;
GetBoundInstance(mapEntry);
}
InstanceGroupBind* Group::GetBoundInstance(Map* aMap)
@@ -1794,6 +1780,25 @@ InstanceGroupBind* Group::GetBoundInstance(Map* aMap)
return NULL;
}
InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry)
{
if (!mapEntry)
return NULL;
Difficulty difficulty = GetDifficulty(mapEntry->IsRaid());
// some instances only have one difficulty
MapDifficulty const* mapDiff = GetMapDifficultyData(mapEntry->MapID,difficulty);
if (!mapDiff)
difficulty = DUNGEON_DIFFICULTY_NORMAL;
BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapEntry->MapID);
if (itr != m_boundInstances[difficulty].end())
return &itr->second;
else
return NULL;
}
InstanceGroupBind* Group::BindToInstance(InstanceSave *save, bool permanent, bool load)
{
+1
View File
@@ -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