From b949d0b982e63032d2eca4cfc8be8b9b2e98c868 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 30 Mar 2014 15:42:05 +0200 Subject: Core/Misc: Defined a few fields in Map.dbc and rewritten InstanceMap::GetMaxPlayers to match what the client does to determine max players --- src/server/game/Maps/Map.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/server/game/Maps') diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 8dc393c5f85..68657640852 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -3183,18 +3183,11 @@ MapDifficulty const* Map::GetMapDifficulty() const uint32 InstanceMap::GetMaxPlayers() const { - if (MapDifficulty const* mapDiff = GetMapDifficulty()) - { - if (mapDiff->maxPlayers || IsRegularDifficulty()) // Normal case (expect that regular difficulty always have correct maxplayers) - return mapDiff->maxPlayers; - else // DBC have 0 maxplayers for heroic instances with expansion < 2 - { // The heroic entry exists, so we don't have to check anything, simply return normal max players - MapDifficulty const* normalDiff = GetMapDifficultyData(GetId(), REGULAR_DIFFICULTY); - return normalDiff ? normalDiff->maxPlayers : 0; - } - } - else // I'd rather ASSERT(false); - return 0; + MapDifficulty const* mapDiff = GetMapDifficulty(); + if (mapDiff && mapDiff->maxPlayers) + return mapDiff->maxPlayers; + + return GetEntry()->maxPlayers; } uint32 InstanceMap::GetMaxResetDelay() const -- cgit v1.2.3