Fixed bug in Player::Satisfy that allowed to sometimes bypass instance requirements

Fixed DisableMgr incorrectly blocking entry into maps when only one mode was disabled

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-07-26 22:25:03 +02:00
parent 31820f0340
commit 4fb256254c
2 changed files with 6 additions and 8 deletions

View File

@@ -218,8 +218,6 @@ bool DisableMgr::IsDisabledFor(DisableType type, uint32 entry, Unit const* pUnit
return true;
}
case DISABLE_TYPE_MAP:
if (!pUnit)
return true;
if (Player const* pPlayer = pUnit->ToPlayer())
{
MapEntry const* mapEntry = sMapStore.LookupEntry(entry);

View File

@@ -1809,7 +1809,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
return false;
}
if ((GetSession()->GetSecurity() < SEC_GAMEMASTER) && sDisableMgr.IsDisabledFor(DISABLE_TYPE_MAP, mapid, NULL))
if ((GetSession()->GetSecurity() < SEC_GAMEMASTER) && sDisableMgr.IsDisabledFor(DISABLE_TYPE_MAP, mapid, this))
{
sLog.outError("Player %s tried to enter a forbidden map", GetName());
return false;
@@ -17489,11 +17489,15 @@ bool Player::Satisfy(AccessRequirement const *ar, uint32 target_map, bool report
uint8 LevelMin = 0;
uint8 LevelMax = 0;
MapEntry const* mapEntry = sMapStore.LookupEntry(target_map);
if (!mapEntry)
return false;
if (!sWorld.getConfig(CONFIG_INSTANCE_IGNORE_LEVEL))
{
if (ar->levelMin && getLevel() < ar->levelMin)
LevelMin = ar->levelMin;
if (ar->heroicLevelMin && GetDungeonDifficulty() == DUNGEON_DIFFICULTY_HEROIC && getLevel() < ar->heroicLevelMin)
if (mapEntry->IsNonRaidDungeon() && ar->heroicLevelMin && GetDungeonDifficulty() == DUNGEON_DIFFICULTY_HEROIC && getLevel() < ar->heroicLevelMin)
LevelMin = ar->heroicLevelMin;
if (ar->levelMax && getLevel() > ar->levelMax)
LevelMax = ar->levelMax;
@@ -17509,10 +17513,6 @@ bool Player::Satisfy(AccessRequirement const *ar, uint32 target_map, bool report
else if (ar->item2 && !HasItemCount(ar->item2, 1))
missingItem = ar->item2;
MapEntry const* mapEntry = sMapStore.LookupEntry(target_map);
if (!mapEntry)
return false;
if (sDisableMgr.IsDisabledFor(DISABLE_TYPE_MAP, target_map, this))
{
GetSession()->SendAreaTriggerMessage(GetSession()->GetTrinityString(LANG_INSTANCE_CLOSED));