From 6b8e906e3929121d8472a4bae0be9b0704058c28 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Wed, 1 Jan 2025 20:40:39 +0800 Subject: [PATCH] Fix LFG leave group --- src/PlayerbotAI.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index eb5e9c29..07aea077 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -392,7 +392,7 @@ void PlayerbotAI::UpdateAI(uint32 elapsed, bool minimal) } } - if (!bot->InBattleground() && !bot->inRandomLfgDungeon() && bot->GetGroup()) + if (!bot->InBattleground() && !bot->inRandomLfgDungeon() && bot->GetGroup() && !bot->GetGroup()->isLFGGroup()) { Player* leader = bot->GetGroup()->GetLeader(); if (leader && leader != bot) // Checks if the leader is valid and is not the bot itself @@ -1312,11 +1312,9 @@ void PlayerbotAI::DoNextAction(bool min) // if in combat but stick with old data - clear targets if (currentEngine == engines[BOT_STATE_NON_COMBAT] && bot->IsInCombat()) { - if (aiObjectContext->GetValue("current target")->Get() != nullptr || - aiObjectContext->GetValue("pull target")->Get() != ObjectGuid::Empty || - aiObjectContext->GetValue("dps target")->Get() != nullptr) + if (aiObjectContext->GetValue("current target")->Get() != nullptr) { - Reset(); + aiObjectContext->GetValue("current target")->Set(nullptr); } }