aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTartalo <none@none>2010-06-26 14:06:29 +0200
committerTartalo <none@none>2010-06-26 14:06:29 +0200
commit57687c5c40e31ff527b64f6dbfe701680c225228 (patch)
tree1075251e71d1fcb3579d18b3fb999075d14f2e56
parent26da69a5444a15e5c1f8b1b57316ef846af969d4 (diff)
Allow GMs to bypass instance entry requirements
--HG-- branch : trunk
-rw-r--r--src/server/game/Maps/MapManager.cpp43
1 files changed, 23 insertions, 20 deletions
diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp
index 47032bd6215..8bb3039800c 100644
--- a/src/server/game/Maps/MapManager.cpp
+++ b/src/server/game/Maps/MapManager.cpp
@@ -161,14 +161,35 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
if (!entry->IsDungeon())
return true;
+ InstanceTemplate const* instance = objmgr.GetInstanceTemplate(mapid);
+ if (!instance)
+ return false;
+
+ //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()));
+ 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;
+ }
+
+ //Bypass checks for GMs
+ if (player->isGameMaster())
+ return true;
+
const char *mapName = entry->name[player->GetSession()->GetSessionDbcLocale()];
Group* pGroup = player->GetGroup();
if (entry->IsRaid())
{
// can only enter in a raid group
- // GMs can avoid raid limitations
- if ((!pGroup || !pGroup->isRaidGroup()) && !player->isGameMaster() && !sWorld.getConfig(CONFIG_INSTANCE_IGNORE_RAID))
+ if ((!pGroup || !pGroup->isRaidGroup()) && !sWorld.getConfig(CONFIG_INSTANCE_IGNORE_RAID))
{
// probably there must be special opcode, because client has this string constant in GlobalStrings.lua
// TODO: this is not a good place to send the message
@@ -178,20 +199,6 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
}
}
- //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()));
- 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;
- }
-
if (!player->isAlive())
{
if (Corpse *corpse = player->GetCorpse())
@@ -221,10 +228,6 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player, bool loginCheck)
sLog.outDebug("Map::CanPlayerEnter - player '%s' is dead but does not have a corpse!", player->GetName());
}
- InstanceTemplate const* instance = objmgr.GetInstanceTemplate(mapid);
- if (!instance)
- return false;
-
//Get instance where player's group is bound & its map
if (pGroup)
{