diff options
author | Shauren <shauren.trinity@gmail.com> | 2014-03-30 15:42:05 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2014-03-30 15:42:05 +0200 |
commit | b949d0b982e63032d2eca4cfc8be8b9b2e98c868 (patch) | |
tree | c80b3d4089c94cc3a33bf084fa111617a326a16d /src/server/game/Maps/Map.cpp | |
parent | 7630b3c6273541f057a168e4abf724903f63f79d (diff) |
Core/Misc: Defined a few fields in Map.dbc and rewritten InstanceMap::GetMaxPlayers to match what the client does to determine max players
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rw-r--r-- | src/server/game/Maps/Map.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
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 |