From 0667fe435f462c027cf2977c0e88affd01d12a3c Mon Sep 17 00:00:00 2001 From: Aeadoin <109764533+Aeadoin@users.noreply.github.com> Date: Fri, 20 Oct 2023 18:45:41 -0400 Subject: [PATCH] [Bug Fix] Fix crash when checking Bot Group/Raid membership (#3641) * [Bug Fix] Fix crash when checking Bot Group/Raid membership * Update bot.cpp --------- Co-authored-by: Akkadius --- zone/bot.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index 77b6c1c47..633f68bec 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -3336,7 +3336,8 @@ bool Bot::Spawn(Client* botCharacterOwner) { if (auto raid = entity_list.GetRaidByBotName(GetName())) { // Safety Check to confirm we have a valid raid - if (!raid->IsRaidMember(GetBotOwner()->GetName())) { + auto owner = GetBotOwner(); + if (owner && !raid->IsRaidMember(owner->GetCleanName())) { Bot::RemoveBotFromRaid(this); } else { SetRaidGrouped(true); @@ -3346,7 +3347,8 @@ bool Bot::Spawn(Client* botCharacterOwner) { } else if (auto group = entity_list.GetGroupByMobName(GetName())) { // Safety Check to confirm we have a valid group - if (!group->IsGroupMember(GetBotOwner()->GetName())) { + auto owner = GetBotOwner(); + if (owner && !group->IsGroupMember(owner->GetCleanName())) { Bot::RemoveBotFromGroup(this, group); } else { SetGrouped(true);