mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 19:37:01 +00:00
[10328] Avoid explcit client max level use for selction bg/arena bracket.
This allow use brackets like 85-89 existed for some maps if at server allowed levels > 80. Before like players placed into bracket for level 80 always.
This commit is contained in:
parent
a977c068f0
commit
1a1a541ecf
2 changed files with 17 additions and 7 deletions
|
|
@ -869,16 +869,26 @@ MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty)
|
||||||
|
|
||||||
PvPDifficultyEntry const* GetBattlegroundBracketByLevel( uint32 mapid, uint32 level )
|
PvPDifficultyEntry const* GetBattlegroundBracketByLevel( uint32 mapid, uint32 level )
|
||||||
{
|
{
|
||||||
// prevent out-of-range levels for dbc data
|
PvPDifficultyEntry const* maxEntry = NULL; // used for level > max listed level case
|
||||||
if (level > DEFAULT_MAX_LEVEL)
|
|
||||||
level = DEFAULT_MAX_LEVEL;
|
|
||||||
|
|
||||||
for(uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
|
for(uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
|
||||||
|
{
|
||||||
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
|
if (PvPDifficultyEntry const* entry = sPvPDifficultyStore.LookupEntry(i))
|
||||||
if (entry->mapId == mapid && entry->minLevel <= level && entry->maxLevel >= level)
|
{
|
||||||
|
// skip unrelated and too-high brackets
|
||||||
|
if (entry->mapId != mapid || entry->minLevel > level)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// exactly fit
|
||||||
|
if (entry->maxLevel >= level)
|
||||||
return entry;
|
return entry;
|
||||||
|
|
||||||
return NULL;
|
// remember for possible out-of-range case (search higher from existed)
|
||||||
|
if (!maxEntry || maxEntry->maxLevel < entry->maxLevel)
|
||||||
|
maxEntry = entry;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return maxEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattleGroundBracketId id)
|
PvPDifficultyEntry const* GetBattlegroundBracketById(uint32 mapid, BattleGroundBracketId id)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10327"
|
#define REVISION_NR "10328"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue