[8884] Fix heroic dungeons maxPlayers issue

Signed-off-by: Lightguard <Lightguard@tauri.hu>
This commit is contained in:
Lightguard 2009-11-24 09:25:23 +01:00 committed by VladimirMangos
parent 63258f2407
commit 2352576f03
3 changed files with 14 additions and 4 deletions

View file

@ -1134,8 +1134,18 @@ MapDifficulty const* Map::GetMapDifficulty() const
uint32 Map::GetMaxPlayers() const
{
MapDifficulty const* mapDiff = GetMapDifficulty();
return mapDiff ? mapDiff->maxPlayers : 0;
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(i_id, REGULAR_DIFFICULTY);
return normalDiff ? normalDiff->maxPlayers : 0;
}
}
else // I'd rather assert(false);
return 0;
}
uint32 Map::GetMaxResetDelay() const