Urand fix

This commit is contained in:
Dustin Hendrickson
2025-10-18 14:14:25 -05:00
parent 74fb4876f5
commit e8bf099b03

View File

@@ -672,7 +672,19 @@ static void AdjustBotToRange(Player* bot, int targetRangeIndex, const LevelRange
} }
else 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); PlayerbotFactory newFactory(bot, newLevel);