mirror of
https://github.com/kadeshar/mod-player-bot-level-brackets.git
synced 2026-01-13 01:08:36 +00:00
Urand fix
This commit is contained in:
@@ -672,7 +672,19 @@ static void AdjustBotToRange(Player* bot, int targetRangeIndex, const LevelRange
|
||||
}
|
||||
else
|
||||
{
|
||||
newLevel = GetRandomLevelInRange(factionRanges[targetRangeIndex]);
|
||||
const LevelRangeConfig& range = factionRanges[targetRangeIndex];
|
||||
if (range.lower > range.upper)
|
||||
{
|
||||
if (g_BotDistFullDebugMode)
|
||||
{
|
||||
std::string playerFaction = IsAlliancePlayerBot(bot) ? "Alliance" : "Horde";
|
||||
LOG_INFO("server.loading",
|
||||
"[BotLevelBrackets] AdjustBotToRange: Invalid range {}-{} for {} bot '{}'.",
|
||||
range.lower, range.upper, playerFaction, bot->GetName());
|
||||
}
|
||||
return;
|
||||
}
|
||||
newLevel = GetRandomLevelInRange(range);
|
||||
}
|
||||
|
||||
PlayerbotFactory newFactory(bot, newLevel);
|
||||
|
||||
Reference in New Issue
Block a user