mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 04:37:00 +00:00
[8884] Fix heroic dungeons maxPlayers issue
Signed-off-by: Lightguard <Lightguard@tauri.hu>
This commit is contained in:
parent
63258f2407
commit
2352576f03
3 changed files with 14 additions and 4 deletions
|
|
@ -1773,7 +1773,7 @@ struct MapDifficulty
|
|||
MapDifficulty(uint32 _resetTime, uint32 _maxPlayers) : resetTime(_resetTime), maxPlayers(_maxPlayers) {}
|
||||
|
||||
uint32 resetTime;
|
||||
uint32 maxPlayers;
|
||||
uint32 maxPlayers; // some heroic dungeons have 0 when expect same value as in normal dificulty case
|
||||
};
|
||||
|
||||
struct TalentSpellPos
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8883"
|
||||
#define REVISION_NR "8884"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue