From 36d1405b524e9aa397ff6e1d5f48f24711766f11 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 10 Aug 2010 19:40:35 +0200 Subject: [PATCH] Fixed bug allowing players to enter instance even if selected difficulty was disabled Added map id to log when player tries to enter disabled map --HG-- branch : trunk --- src/server/game/Conditions/DisableMgr.cpp | 4 +++- src/server/game/Entities/Player/Player.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index 505f76469f..9de97269f6 100644 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -238,7 +238,9 @@ bool DisableMgr::IsDisabledFor(DisableType type, uint32 entry, Unit const* pUnit if (mapEntry->IsDungeon()) { uint8 disabledModes = itr->second; - switch(mapEntry->IsRaid() ? pPlayer->GetRaidDifficulty() : pPlayer->GetDungeonDifficulty()) + Difficulty targetDifficulty = pPlayer->GetDifficulty(mapEntry->IsRaid()); + GetDownscaledMapDifficultyData(entry, targetDifficulty); + switch(targetDifficulty) { case DUNGEON_DIFFICULTY_NORMAL: return disabledModes & DUNGEON_STATUSFLAG_NORMAL; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 6ba33bb151..f477d96ef8 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -1812,7 +1812,8 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati if ((GetSession()->GetSecurity() < SEC_GAMEMASTER) && sDisableMgr.IsDisabledFor(DISABLE_TYPE_MAP, mapid, this)) { - sLog.outError("Player %s tried to enter a forbidden map", GetName()); + sLog.outError("Player %s tried to enter a forbidden map %u", GetName(), mapid); + SendTransferAborted(mapid, TRANSFER_ABORT_MAP_NOT_ALLOWED); return false; }