diff options
author | Shauren <shauren.trinity@gmail.com> | 2014-07-09 13:57:38 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2014-07-09 13:57:38 +0200 |
commit | 6664b7ecd4066c17d4aaa4248b18b9bb7e666ae5 (patch) | |
tree | 23586fc4d9c61a932f0956e52b83e41e766f70ff /src | |
parent | a96771aca6722284b09a59e305aedb82a76f5dca (diff) |
Core/Instances: Enable automatic changing dungeon difficulty to a lower one when currently selected difficulty does not exist for entered instance
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Maps/MapManager.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index d8c8889da67..0b8c6401d89 100644 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -131,21 +131,15 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck) if (!instance) return false; - Difficulty targetDifficulty = player->GetDifficulty(entry->IsRaid()); - //The player has a heroic mode and tries to enter into instance which has no a heroic mode - MapDifficulty const* mapDiff = GetMapDifficultyData(entry->MapID, targetDifficulty); + Difficulty targetDifficulty, requestedDifficulty; + targetDifficulty = requestedDifficulty = player->GetDifficulty(entry->IsRaid()); + // Get the highest available difficulty if current setting is higher than the instance allows + MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(entry->MapID, targetDifficulty); if (!mapDiff) { - // Send aborted message for dungeons - if (entry->IsNonRaidDungeon()) - { - player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, player->GetDungeonDifficulty()); - return false; - } - else // attempt to downscale - mapDiff = GetDownscaledMapDifficultyData(entry->MapID, targetDifficulty); + player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, requestedDifficulty); + return false; } - // FIXME: mapDiff is never used //Bypass checks for GMs if (player->IsGameMaster()) |