More bot raid changes

This commit is contained in:
neckkola
2022-01-15 11:27:50 -04:00
parent 0d009a7a25
commit 37e9d419e6
7 changed files with 1555 additions and 53 deletions
+6 -13
View File
@@ -2300,7 +2300,11 @@ bool Bot::Process()
}
// Bot AI
AI_Process();
Raid* raid = entity_list.GetRaidByBot(this);
if (raid)
AI_Process_Raid();
else
AI_Process();
return true;
}
@@ -2540,12 +2544,10 @@ void Bot::AI_Process()
Client* bot_owner = (GetBotOwner() && GetBotOwner()->IsClient() ? GetBotOwner()->CastToClient() : nullptr);
Group* bot_group = GetGroup();
Raid* bot_raid = entity_list.GetRaidByBot(this);
//#pragma region PRIMARY AI SKIP CHECKS
// Primary reasons for not processing AI
if (!bot_owner || (!bot_group && !bot_raid) || !IsAIControlled()) {
if (!bot_owner || (!bot_group) || !IsAIControlled()) {
return;
}
@@ -2563,15 +2565,6 @@ void Bot::AI_Process()
if (bot_group) {
leash_owner = (bot_group->GetLeader() && bot_group->GetLeader()->IsClient() ? bot_group->GetLeader()->CastToClient() : bot_owner);
}
else if (bot_raid) {
int bot_raid_group = bot_raid->GetGroup(GetName());
if (bot_raid_group > 0) {
leash_owner = bot_raid->GetGroupLeader(bot_raid_group)->CastToClient();
}
else {
leash_owner = bot_raid->GetLeader();
}
}
if (!leash_owner) {
return;