mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user