From 61dbae19dc63b34339182fd3779bef42ec9c5aa2 Mon Sep 17 00:00:00 2001 From: kadeshar Date: Sat, 16 May 2026 08:26:34 +0200 Subject: [PATCH] Fix for lfg command (#2379) ## Pull Request Description Fix for `lfg` to include healers in invitations and requester role. ## How to Test the Changes Use command `/1 lfg 40` on server which contains correct amount of bots possible to be invited. Such group should be create. ## 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? - - [ ] No - - [x] Yes (**explain below**) To identify reason. ## 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/Ai/Base/Actions/InviteToGroupAction.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Ai/Base/Actions/InviteToGroupAction.cpp b/src/Ai/Base/Actions/InviteToGroupAction.cpp index 8b71eadef..e7bcb4da8 100644 --- a/src/Ai/Base/Actions/InviteToGroupAction.cpp +++ b/src/Ai/Base/Actions/InviteToGroupAction.cpp @@ -308,9 +308,8 @@ bool LfgAction::Execute(Event event) allowedRoles[BOT_ROLE_HEALER] = 1; allowedRoles[BOT_ROLE_DPS] = 3; - BotRoles role = botAI->IsTank(requester, false) - ? BOT_ROLE_TANK - : (botAI->IsHeal(requester, false) ? BOT_ROLE_HEALER : BOT_ROLE_DPS); + BotRoles role = botAI->IsTank(requester, true) ? BOT_ROLE_TANK + : (botAI->IsHeal(requester, true) ? BOT_ROLE_HEALER : BOT_ROLE_DPS); Classes cls = (Classes)requester->getClass(); if (group) @@ -383,8 +382,8 @@ bool LfgAction::Execute(Event event) if (!botAI->IsSafe(player)) return false; - role = botAI->IsTank(player, false) ? BOT_ROLE_TANK - : (botAI->IsHeal(player, false) ? BOT_ROLE_HEALER : BOT_ROLE_DPS); + role = botAI->IsTank(player, true) ? BOT_ROLE_TANK + : (botAI->IsHeal(player, true) ? BOT_ROLE_HEALER : BOT_ROLE_DPS); cls = (Classes)player->getClass(); if (allowedRoles[role] > 0) @@ -403,7 +402,7 @@ bool LfgAction::Execute(Event event) allowedClassNr[cls][role]--; } - role = botAI->IsTank(bot, false) ? BOT_ROLE_TANK : (botAI->IsHeal(bot, false) ? BOT_ROLE_HEALER : BOT_ROLE_DPS); + role = botAI->IsTank(bot, true) ? BOT_ROLE_TANK : (botAI->IsHeal(bot, true) ? BOT_ROLE_HEALER : BOT_ROLE_DPS); cls = (Classes)bot->getClass(); if (allowedRoles[role] == 0)