Minor updates after patches

only freeze bots during init when not in combat
This commit is contained in:
bash
2024-12-19 19:49:07 +01:00
committed by GitHub
parent ea1ec98645
commit 2acf8e4b13

View File

@@ -4135,18 +4135,27 @@ inline bool ZoneHasRealPlayers(Player* bot)
bool PlayerbotAI::AllowActive(ActivityType activityType)
{
// Is in combat. Always defend yourself.
if (activityType != OUT_OF_PARTY_ACTIVITY && activityType != PACKET_ACTIVITY)
{
if (bot->IsInCombat())
{
return true;
}
}
// only keep updating till initializing time has completed,
// which prevents unneeded expensive GameTime calls.
// if (_isBotInitializing)
// {
// _isBotInitializing = GameTime::GetUptime().count() < sPlayerbotAIConfig->maxRandomBots * 0.12;
if (_isBotInitializing)
{
_isBotInitializing = GameTime::GetUptime().count() < sPlayerbotAIConfig->maxRandomBots * 0.12;
// // no activity allowed during bot initialization
// if (_isBotInitializing)
// {
// return false;
// }
// }
// no activity allowed during bot initialization
if (_isBotInitializing)
{
return false;
}
}
// General exceptions
if (activityType == PACKET_ACTIVITY)
@@ -4154,21 +4163,18 @@ bool PlayerbotAI::AllowActive(ActivityType activityType)
return true;
}
// when botActiveAlone is 100% and smartScale disabled
if (sPlayerbotAIConfig->botActiveAlone >= 100 && !sPlayerbotAIConfig->botActiveAloneSmartScale)
{
return true;
}
// bg, raid, dungeon
if (!WorldPosition(bot).isOverworld())
{
return true;
}
// Is in combat. Defend yourself.
if (activityType != OUT_OF_PARTY_ACTIVITY && activityType != PACKET_ACTIVITY)
{
if (bot->IsInCombat())
{
return true;
}
}
// bot map has active players.
if (sPlayerbotAIConfig->BotActiveAloneForceWhenInMap)
{
@@ -4307,10 +4313,6 @@ bool PlayerbotAI::AllowActive(ActivityType activityType)
{
return false;
}
if (sPlayerbotAIConfig->botActiveAlone >= 100 && !sPlayerbotAIConfig->botActiveAloneSmartScale)
{
return true;
}
// #######################################################################################
// All mandatory conditations are checked to be active or not, from here the remaining