mirror of
https://github.com/kadeshar/mod-player-bot-level-brackets.git
synced 2026-01-13 01:08:36 +00:00
Adding bot safety check
This commit is contained in:
@@ -554,17 +554,26 @@ static void ProcessPendingLevelResets()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
Player* bot = it->bot;
|
Player* bot = it->bot;
|
||||||
|
|
||||||
|
if (!bot || !bot->IsInWorld())
|
||||||
|
{
|
||||||
|
it = g_PendingLevelResets.erase(it);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
int targetRange = it->targetRange;
|
int targetRange = it->targetRange;
|
||||||
if (g_IgnoreGuildBotsWithRealPlayers && BotInGuildWithRealPlayer(bot))
|
if (g_IgnoreGuildBotsWithRealPlayers && BotInGuildWithRealPlayer(bot))
|
||||||
{
|
{
|
||||||
it = g_PendingLevelResets.erase(it);
|
it = g_PendingLevelResets.erase(it);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_IgnoreFriendListed && BotInFriendList(bot))
|
if (g_IgnoreFriendListed && BotInFriendList(bot))
|
||||||
{
|
{
|
||||||
it = g_PendingLevelResets.erase(it);
|
it = g_PendingLevelResets.erase(it);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bot && bot->IsInWorld() && IsBotSafeForLevelReset(bot))
|
if (bot && bot->IsInWorld() && IsBotSafeForLevelReset(bot))
|
||||||
{
|
{
|
||||||
AdjustBotToRange(bot, targetRange, it->factionRanges);
|
AdjustBotToRange(bot, targetRange, it->factionRanges);
|
||||||
|
|||||||
Reference in New Issue
Block a user