aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/MapManager.cpp
diff options
context:
space:
mode:
authorShauren <none@none>2010-07-29 18:11:41 +0200
committerShauren <none@none>2010-07-29 18:11:41 +0200
commitade1bbdd62f980e7c1284f4f39dbd7f1fbf98860 (patch)
tree791c58dc29d7c226e6bc1837f22b6a6fb1d6b136 /src/server/game/Maps/MapManager.cpp
parentdfe5ae36d33f2cceb6868d4a1d543804f94925b2 (diff)
Remade access_requirement table, now each difficulty mode for each instance has its own entry (for future Dungeon Finder development)
Added completed achievement as new requirement type Removed obsolete access_id from areatrigger_teleport table Implemented automatic downscaling of raid difficulty when requested mode does not exist Changed dungeon_difficulty in characters table to instance_mode_mask saving both dungeon and raid difficulty in form (dungeon diff | raid diff << 4) --HG-- branch : trunk
Diffstat (limited to 'src/server/game/Maps/MapManager.cpp')
-rw-r--r--src/server/game/Maps/MapManager.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp
index 5cdd2f90089..5e8a2803419 100644
--- a/src/server/game/Maps/MapManager.cpp
+++ b/src/server/game/Maps/MapManager.cpp
@@ -165,18 +165,19 @@ 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,player->GetDifficulty(entry->IsRaid()));
+ MapDifficulty const* mapDiff = GetMapDifficultyData(entry->MapID, targetDifficulty);
if (!mapDiff)
{
- bool isNormalTargetMap = entry->IsRaid()
- ? (player->GetRaidDifficulty() == RAID_DIFFICULTY_10MAN_NORMAL)
- : (player->GetDungeonDifficulty() == DUNGEON_DIFFICULTY_NORMAL);
-
- // Send aborted message
- // FIX ME: what about absent normal/heroic mode with specific players limit...
- player->SendTransferAborted(mapid, TRANSFER_ABORT_DIFFICULTY, isNormalTargetMap ? DUNGEON_DIFFICULTY_NORMAL : DUNGEON_DIFFICULTY_HEROIC);
- return false;
+ // 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);
}
//Bypass checks for GMs
@@ -249,7 +250,7 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
}
//Other requirements
- return player->Satisfy(objmgr.GetAccessRequirement(instance->access_id), mapid, true);
+ return player->Satisfy(objmgr.GetAccessRequirement(mapid, targetDifficulty), mapid, true);
}
void MapManager::RemoveBonesFromMap(uint32 mapid, uint64 guid, float x, float y)