mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Minor updates after patches
only freeze bots during init when not in combat
This commit is contained in:
@@ -4135,18 +4135,27 @@ inline bool ZoneHasRealPlayers(Player* bot)
|
|||||||
|
|
||||||
bool PlayerbotAI::AllowActive(ActivityType activityType)
|
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,
|
// only keep updating till initializing time has completed,
|
||||||
// which prevents unneeded expensive GameTime calls.
|
// which prevents unneeded expensive GameTime calls.
|
||||||
// if (_isBotInitializing)
|
if (_isBotInitializing)
|
||||||
// {
|
{
|
||||||
// _isBotInitializing = GameTime::GetUptime().count() < sPlayerbotAIConfig->maxRandomBots * 0.12;
|
_isBotInitializing = GameTime::GetUptime().count() < sPlayerbotAIConfig->maxRandomBots * 0.12;
|
||||||
|
|
||||||
// // no activity allowed during bot initialization
|
// no activity allowed during bot initialization
|
||||||
// if (_isBotInitializing)
|
if (_isBotInitializing)
|
||||||
// {
|
{
|
||||||
// return false;
|
return false;
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// General exceptions
|
// General exceptions
|
||||||
if (activityType == PACKET_ACTIVITY)
|
if (activityType == PACKET_ACTIVITY)
|
||||||
@@ -4154,21 +4163,18 @@ bool PlayerbotAI::AllowActive(ActivityType activityType)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// when botActiveAlone is 100% and smartScale disabled
|
||||||
|
if (sPlayerbotAIConfig->botActiveAlone >= 100 && !sPlayerbotAIConfig->botActiveAloneSmartScale)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// bg, raid, dungeon
|
// bg, raid, dungeon
|
||||||
if (!WorldPosition(bot).isOverworld())
|
if (!WorldPosition(bot).isOverworld())
|
||||||
{
|
{
|
||||||
return true;
|
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.
|
// bot map has active players.
|
||||||
if (sPlayerbotAIConfig->BotActiveAloneForceWhenInMap)
|
if (sPlayerbotAIConfig->BotActiveAloneForceWhenInMap)
|
||||||
{
|
{
|
||||||
@@ -4307,11 +4313,7 @@ bool PlayerbotAI::AllowActive(ActivityType activityType)
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (sPlayerbotAIConfig->botActiveAlone >= 100 && !sPlayerbotAIConfig->botActiveAloneSmartScale)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// #######################################################################################
|
// #######################################################################################
|
||||||
// All mandatory conditations are checked to be active or not, from here the remaining
|
// All mandatory conditations are checked to be active or not, from here the remaining
|
||||||
// situations are usable for scaling when enabled.
|
// situations are usable for scaling when enabled.
|
||||||
|
|||||||
Reference in New Issue
Block a user