aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 49387cdbcdb..31959d83ec6 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -20687,24 +20687,17 @@ bool Player::GetBGAccessByLevel(BattleGroundTypeId bgTypeId) const
if(!bg)
return false;
- if(getLevel() < bg->GetMinLevel() || getLevel() > bg->GetMaxLevel())
+ // limit check leel to dbc compatible level range
+ uint32 level = getLevel();
+ if (level > DEFAULT_MAX_LEVEL)
+ level = DEFAULT_MAX_LEVEL;
+
+ if(level < bg->GetMinLevel() || level > bg->GetMaxLevel())
return false;
return true;
}
-BGQueueIdBasedOnLevel Player::GetBattleGroundQueueIdFromLevel(BattleGroundTypeId bgTypeId) const
-{
- // for ranges 0 - 19, 20 - 29, 30 - 39, 40 - 49, 50 - 59, 60 - 69, 70 - 79, 80
- uint32 queue_id = ( getLevel() / 10) - 1;
- if (queue_id >= MAX_BATTLEGROUND_QUEUES)
- {
- sLog.outError("BattleGround: too high queue_id %u this shouldn't happen", queue_id);
- return QUEUE_ID_MAX_LEVEL_80;
- }
- return BGQueueIdBasedOnLevel(queue_id);
-}
-
float Player::GetReputationPriceDiscount( Creature const* pCreature ) const
{
FactionTemplateEntry const* vendor_faction = pCreature->getFactionTemplateEntry();