From d8926cd5f37ba2092b1dd1eaa5925045426ddd2e Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Sat, 7 Oct 2023 14:00:19 -0500 Subject: [PATCH] [Crash] Fix dangling pointer crash observed in SendHPPacketsFrom (#3611) * [Crash] Fix dangling pointer crash observed in SendHPPacketsFrom * Update bot.cpp --- zone/bot.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zone/bot.cpp b/zone/bot.cpp index 5541ede4d..125b08c94 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -465,6 +465,14 @@ Bot::~Bot() { } entity_list.RemoveBot(GetID()); + + if (GetGroup()) { + GetGroup()->DelMember(this); + } + + if (GetRaid()) { + GetRaid()->RemoveMember(GetName()); + } } void Bot::SetBotID(uint32 botID) {