From e177901402084ee57224d625d87b87208c510bf2 Mon Sep 17 00:00:00 2001 From: bashermens <31279994+hermensbas@users.noreply.github.com> Date: Sat, 11 Apr 2026 07:18:13 +0200 Subject: [PATCH] Bug(self-bot): Self-bot should face target when using ranged or melee attack (#2300) ## Pull Request Description Currently when using self-bot and that self-bot is using ranged attacks its not facing the target, this happens because the client doesnt receive the instruction in Player::SendMessageToSet(WorldPacket const* data, bool self); ## How to Test the Changes Create new character with uses range attack as base attack (hunter, mage, druid etc) and observe. Apply patch and observe your self-bot character is now always facing towards the target. ## Impact Assessment - Does this change increase per-bot/per-tick processing or risk scaling poorly with thousands of bots? - - [x] No, not at all - - [ ] Minimal impact (**explain below**) - - [ ] Moderate impact (**explain below**) - Does this change modify default bot behavior? - - [x] No - - [ ] Yes (**explain why**) - Does this change add new decision branches or increase maintenance complexity? - - [x] No - - [ ] Yes (**explain below**) ## AI Assistance Was AI assistance used while working on this change? - - [x] No - - [ ] Yes (**explain below**) ## Final Checklist - - [x] Stability is not compromised. - - [x] Performance impact is understood, tested, and acceptable. - - [x] Added logic complexity is justified and explained. - - [x] Any new bot dialogue lines are translated. - - [x] Documentation updated if needed (Conf comments, WiKi commands). ## Notes for Reviewers --- src/Util/ServerFacade.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Util/ServerFacade.cpp b/src/Util/ServerFacade.cpp index 12a77de63..1ba1eb5ea 100644 --- a/src/Util/ServerFacade.cpp +++ b/src/Util/ServerFacade.cpp @@ -53,8 +53,9 @@ void ServerFacade::SetFacingTo(Player* bot, WorldObject* wo, bool force) bot->SetOrientation(angle); if (!bot->IsRooted()) - bot->SendMovementFlagUpdate(); - // } + // enforce (bool self) true otherwhise when using real-client with self-bot wont + // recieve update; e.g. will not face the target when using (mostly ranged) attack + bot->SendMovementFlagUpdate(true); } Unit* ServerFacade::GetChaseTarget(Unit* target)