Fix some deprecated checks on MapManager::CanPlayerEnter()
--HG-- branch : trunk
This commit is contained in:
@@ -1760,21 +1760,7 @@ InstanceGroupBind* Group::GetBoundInstance(Player* player)
|
|||||||
{
|
{
|
||||||
uint32 mapid = player->GetMapId();
|
uint32 mapid = player->GetMapId();
|
||||||
MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
|
MapEntry const* mapEntry = sMapStore.LookupEntry(mapid);
|
||||||
if (!mapEntry)
|
GetBoundInstance(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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InstanceGroupBind* Group::GetBoundInstance(Map* aMap)
|
InstanceGroupBind* Group::GetBoundInstance(Map* aMap)
|
||||||
@@ -1794,6 +1780,25 @@ InstanceGroupBind* Group::GetBoundInstance(Map* aMap)
|
|||||||
return NULL;
|
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)
|
InstanceGroupBind* Group::BindToInstance(InstanceSave *save, bool permanent, bool load)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -358,6 +358,7 @@ class Group
|
|||||||
void UnbindInstance(uint32 mapid, uint8 difficulty, bool unload = false);
|
void UnbindInstance(uint32 mapid, uint8 difficulty, bool unload = false);
|
||||||
InstanceGroupBind* GetBoundInstance(Player* player);
|
InstanceGroupBind* GetBoundInstance(Player* player);
|
||||||
InstanceGroupBind* GetBoundInstance(Map* aMap);
|
InstanceGroupBind* GetBoundInstance(Map* aMap);
|
||||||
|
InstanceGroupBind* GetBoundInstance(MapEntry const* mapEntry);
|
||||||
BoundInstancesMap& GetBoundInstances(Difficulty difficulty) { return m_boundInstances[difficulty]; }
|
BoundInstancesMap& GetBoundInstances(Difficulty difficulty) { return m_boundInstances[difficulty]; }
|
||||||
|
|
||||||
// FG: evil hacks
|
// FG: evil hacks
|
||||||
|
|||||||
@@ -228,13 +228,13 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
|
|||||||
//Get instance where player's group is bound & its map
|
//Get instance where player's group is bound & its map
|
||||||
if (pGroup)
|
if (pGroup)
|
||||||
{
|
{
|
||||||
InstanceGroupBind* boundedInstance = pGroup->GetBoundInstance(player);
|
InstanceGroupBind* boundedInstance = pGroup->GetBoundInstance(entry);
|
||||||
if (boundedInstance && boundedInstance->save)
|
if (boundedInstance && boundedInstance->save)
|
||||||
{
|
{
|
||||||
if (Map *boundedMap = sMapMgr.FindMap(mapid,boundedInstance->save->GetInstanceId()))
|
if (Map *boundedMap = sMapMgr.FindMap(mapid,boundedInstance->save->GetInstanceId()))
|
||||||
{
|
{
|
||||||
// Player permanently bounded to different instance than groups one
|
// 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 &&
|
if (playerBoundedInstance && playerBoundedInstance->perm && playerBoundedInstance->save &&
|
||||||
boundedInstance->save->GetInstanceId() != playerBoundedInstance->save->GetInstanceId())
|
boundedInstance->save->GetInstanceId() != playerBoundedInstance->save->GetInstanceId())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user