mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
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:
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user