aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Conditions/DisableMgr.cpp2
-rw-r--r--src/server/game/Entities/Player/Player.cpp12
2 files changed, 6 insertions, 8 deletions
diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp
index 803d607b7f8..1900626dff5 100644
--- a/src/server/game/Conditions/DisableMgr.cpp
+++ b/src/server/game/Conditions/DisableMgr.cpp
@@ -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);
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index b7f41466df4..44869b67b2f 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -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));