[Crash] Fix out of bound arrays, other potential crashes (#3166)

This commit is contained in:
Aeadoin
2023-04-01 12:44:41 -04:00
committed by GitHub
parent 0d509a7f3a
commit 0df84e1ee6
9 changed files with 34 additions and 24 deletions
+6 -1
View File
@@ -1936,6 +1936,11 @@ void Bot::AI_Process()
#define NOT_PASSIVE (GetBotStance() != EQ::constants::stancePassive)
Client* bot_owner = (GetBotOwner() && GetBotOwner()->IsClient() ? GetBotOwner()->CastToClient() : nullptr);
if (!bot_owner) {
return;
}
auto raid = entity_list.GetRaidByBotName(GetName());
uint32 r_group = RAID_GROUPLESS;
if (raid) {
@@ -2983,7 +2988,7 @@ void Bot::HealRotationChecks() {
bool Bot::IsAIProcessValid(const Client* bot_owner, const Group* bot_group, const Raid* raid) {
if (!bot_owner || !bot_group && !raid || !IsAIControlled()) {
if (!bot_owner || (!bot_group && !raid) || !IsAIControlled()) {
return false;
}