diff options
author | Shauren <none@none> | 2010-07-26 22:25:03 +0200 |
---|---|---|
committer | Shauren <none@none> | 2010-07-26 22:25:03 +0200 |
commit | 4fb256254c4abb5d65fbaca7fcdf5cf33322f00c (patch) | |
tree | 5fc15b329b9d20f1d299a32a271bec9c02c9dd66 /src | |
parent | 31820f03407a579c58beda65a83199f052842385 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Conditions/DisableMgr.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 12 |
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)); |