Core/Misc: Defined a few fields in Map.dbc and rewritten InstanceMap::GetMaxPlayers to match what the client does to determine max players

This commit is contained in:
Shauren
2014-03-30 15:42:05 +02:00
parent 7630b3c627
commit b949d0b982
5 changed files with 18 additions and 18 deletions

View File

@@ -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