mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-13 09:07:19 +00:00
Fix ACCESS_VIOLATION in mod-playerbots: purge stale AIs, add thread-safety, and harden HasRealPlayerMaster (#1507)
This commit is contained in:
@@ -363,6 +363,10 @@ public:
|
||||
|
||||
void OnPlayerbotLogout(Player* player) override
|
||||
{
|
||||
// immediate purge of the bot's AI upon disconnection
|
||||
if (player && player->GetSession()->IsBot())
|
||||
sPlayerbotsMgr->RemovePlayerbotAI(player->GetGUID()); // removes a long-standing crash (0xC0000005 ACCESS_VIOLATION)
|
||||
|
||||
if (PlayerbotMgr* playerbotMgr = GET_PLAYERBOT_MGR(player))
|
||||
{
|
||||
PlayerbotAI* botAI = GET_PLAYERBOT_AI(player);
|
||||
|
||||
Reference in New Issue
Block a user