Skip to content

Integrate playerbots module from mangoszero into mangostwo#201

Open
Copilot wants to merge 2 commits intomasterfrom
copilot/checkout-pull-188
Open

Integrate playerbots module from mangoszero into mangostwo#201
Copilot wants to merge 2 commits intomasterfrom
copilot/checkout-pull-188

Conversation

Copy link

Copilot AI commented Feb 28, 2026

PR #188 adds the playerbot and ahbot modules from mangoszero but was blocked by a linker error (undefined reference to Player::BuyItemFromVendor) and a preprocessor typo. This PR applies all changes from that branch onto the current master-based HEAD.

New Module

  • src/modules/Bots/ (~600 files): complete playerbot AI framework (all classes including DK) + ahbot module

Core Integration (#ifdef ENABLE_PLAYERBOTS guards throughout)

  • Player.cpp/h: bot member vars (m_playerbotAI, m_playerbotMgr), ctor/dtor lifecycle, per-tick UpdateAI dispatch
  • WorldSession.cpp: outgoing packet fan-out to bot handlers; bot session management on login/logout; HandleBotPackets()
  • CharacterHandler.cpp: PlayerbotLoginQueryHolder + PlayerbotHolder::AddPlayerBot() for async bot login
  • ChatHandler.cpp: routes whisper/party/raid/guild/channel chat to bot HandleCommand()
  • Chat.cpp/h: registers bot, rndbot, auctionbot chat commands
  • World.cpp/h: bot config keys (CONFIG_BOOL_PLAYERBOT_*, CONFIG_FLOAT_PLAYERBOT_*), auctionbot.Init(), per-tick random bot + ahbot updates, shutdown logout
  • AuctionHouseBot.cpp/h: extracts Enabled() predicate; used by AHBotCommands.cpp guard
  • Map.cpp: skips ResetMap() for bot players; Item.cpp: skips SendTimeUpdate; Spell.cpp: map validity check post-finish; Group.h: GetTargetIcon() accessor

Bug Fixes

  • Linker error: Player::BuyItemFromVendor(ObjectGuid, uint32, uint8, uint8, uint8) was declared but never defined. Implemented as a slot-search wrapper over BuyItemFromVendorSlot:
    for (uint32 i = 0; i < vCount + tCount; ++i) {
        VendorItem const* crItem = i < vCount ? vItems->GetItem(i) : tItems->GetItem(i - vCount);
        if (crItem && crItem->item == item)
            return BuyItemFromVendorSlot(vendorGuid, i, item, count, bag, slot);
    }
  • Preprocessor typo: #ifdef ENABLE_PLAYERBOTS]#ifdef ENABLE_PLAYERBOTS in World.cpp
  • .gitignore: added /.vscode

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


This change is Reviewable

…ame code

Co-authored-by: billy1arm <2219118+billy1arm@users.noreply.github.com>
Copilot AI changed the title [WIP] Checkout pull request 188 for local editing Merge PR #188: Integrate playerbots module from mangoszero into mangostwo Mar 1, 2026
@AppVeyorBot
Copy link

Build Mangos TWO Server 22.02.159 completed (commit a963100334 by @Copilot)

@billy1arm billy1arm changed the title Merge PR #188: Integrate playerbots module from mangoszero into mangostwo Integrate playerbots module from mangoszero into mangostwo Mar 1, 2026
@billy1arm
Copy link
Member

@leprasmurf - I've built this PR based on your original one (with the help of copilot).

Can you review and see if you're happy with it

@billy1arm billy1arm marked this pull request as ready for review March 1, 2026 08:03
Copilot AI review requested due to automatic review settings March 1, 2026 08:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Integrates the mangoszero Playerbots (playerbot + random bots) and AhBot modules into mangostwo, adding core hooks behind #ifdef ENABLE_PLAYERBOTS and fixing a missing Player::BuyItemFromVendor(...) definition.

Changes:

  • Adds the full playerbot/ahbot modules under src/modules/Bots/ plus configuration templates.
  • Wires bot lifecycle + per-tick updates into core (World/Session/Chat/Character login/logout) under ENABLE_PLAYERBOTS.
  • Fixes the previously missing Player::BuyItemFromVendor(...) implementation and adjusts some gameplay/core behaviors for bots.

Reviewed changes

Copilot reviewed 171 out of 621 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
src/modules/Bots/playerbot/strategy/actions/LootStrategyAction.h Adds loot-strategy action declaration for playerbot chat/AI.
src/modules/Bots/playerbot/strategy/actions/LootStrategyAction.cpp Implements loot strategy query/set and always-loot list management.
src/modules/Bots/playerbot/strategy/actions/LootRollAction.h Adds group loot roll handler action type.
src/modules/Bots/playerbot/strategy/actions/LootRollAction.cpp Implements bot voting logic for loot rolls.
src/modules/Bots/playerbot/strategy/actions/LootAction.h Introduces loot/open/store loot action interfaces.
src/modules/Bots/playerbot/strategy/actions/LogLevelAction.h Adds action to change/query bot log verbosity.
src/modules/Bots/playerbot/strategy/actions/LogLevelAction.cpp Implements log level mapping and update behavior.
src/modules/Bots/playerbot/strategy/actions/ListSpellsAction.h Adds action to list bot spells.
src/modules/Bots/playerbot/strategy/actions/ListSpellsAction.cpp Implements spell listing with filtering/ignore lists.
src/modules/Bots/playerbot/strategy/actions/ListQuestsActions.h Adds quest listing action + filtering enum.
src/modules/Bots/playerbot/strategy/actions/ListQuestsActions.cpp Implements quest listing + summary reporting.
src/modules/Bots/playerbot/strategy/actions/LfgActions.h Adds placeholder header for future LFG actions.
src/modules/Bots/playerbot/strategy/actions/LfgActions.cpp Adds placeholder translation unit (mostly commented out).
src/modules/Bots/playerbot/strategy/actions/LeaveGroupAction.h Adds leave/uninvite handling actions for bots.
src/modules/Bots/playerbot/strategy/actions/InviteToGroupAction.h Adds action to invite master to group.
src/modules/Bots/playerbot/strategy/actions/InventoryChangeFailureAction.h Adds inventory error reaction action declaration.
src/modules/Bots/playerbot/strategy/actions/InventoryChangeFailureAction.cpp Implements bot messaging for inventory failures.
src/modules/Bots/playerbot/strategy/actions/InventoryAction.h Adds common inventory helper base for multiple actions.
src/modules/Bots/playerbot/strategy/actions/HelpAction.h Adds help action declaration for bot commands/strategies.
src/modules/Bots/playerbot/strategy/actions/HelpAction.cpp Implements command + strategy listing output.
src/modules/Bots/playerbot/strategy/actions/GuildBankAction.h Adds guild bank inventory action interface.
src/modules/Bots/playerbot/strategy/actions/GuildBankAction.cpp Adds commented-out/disabled guild bank implementation.
src/modules/Bots/playerbot/strategy/actions/GuildAcceptAction.h Adds guild invite accept/decline action interface.
src/modules/Bots/playerbot/strategy/actions/GuildAcceptAction.cpp Implements guild invite accept/decline logic.
src/modules/Bots/playerbot/strategy/actions/GossipHelloAction.h Adds gossip interaction action interface.
src/modules/Bots/playerbot/strategy/actions/GossipHelloAction.cpp Implements gossip hello/select behaviors for bots.
src/modules/Bots/playerbot/strategy/actions/GenericSpellActions.cpp Implements generic spell-usefulness helpers.
src/modules/Bots/playerbot/strategy/actions/GenericActions.h Adds generic combat actions (melee) wiring.
src/modules/Bots/playerbot/strategy/actions/GenericActions.cpp Adds placeholder translation unit for generic actions.
src/modules/Bots/playerbot/strategy/actions/FollowActions.h Adds follow and “be near” movement action declarations.
src/modules/Bots/playerbot/strategy/actions/FollowActions.cpp Implements follow behaviors and random nearby movement.
src/modules/Bots/playerbot/strategy/actions/EquipAction.h Adds equip action interface.
src/modules/Bots/playerbot/strategy/actions/EquipAction.cpp Implements equipping/ammo setting via queued packets.
src/modules/Bots/playerbot/strategy/actions/EmoteAction.h Adds emote action interface + emote registry.
src/modules/Bots/playerbot/strategy/actions/EmoteAction.cpp Implements emote selection and emote map initialization.
src/modules/Bots/playerbot/strategy/actions/DropQuestAction.h Adds quest abandon action interface.
src/modules/Bots/playerbot/strategy/actions/DropQuestAction.cpp Implements quest abandon handling.
src/modules/Bots/playerbot/strategy/actions/DestroyItemAction.h Adds destroy item action interface.
src/modules/Bots/playerbot/strategy/actions/DestroyItemAction.cpp Implements inventory destroy + DB save behavior.
src/modules/Bots/playerbot/strategy/actions/ChooseTargetActions.h Adds target selection and attack actions (assist/grind/RTI).
src/modules/Bots/playerbot/strategy/actions/CheckMountStateAction.h Adds mount sync action interface.
src/modules/Bots/playerbot/strategy/actions/CheckMountStateAction.cpp Implements mount/unmount mirroring with master.
src/modules/Bots/playerbot/strategy/actions/ChatShortcutActions.h Adds shortcut actions for follow/stay/flee/grind/etc.
src/modules/Bots/playerbot/strategy/actions/ChatShortcutActions.cpp Implements shortcut strategy switching and messaging.
src/modules/Bots/playerbot/strategy/actions/ChangeTalentsAction.h Adds placeholder talents action interface.
src/modules/Bots/playerbot/strategy/actions/ChangeTalentsAction.cpp Adds placeholder talents action implementation.
src/modules/Bots/playerbot/strategy/actions/ChangeStrategyAction.h Adds actions to change combat/noncombat/dead strategies.
src/modules/Bots/playerbot/strategy/actions/ChangeStrategyAction.cpp Implements strategy switching and restrictions for random bots.
src/modules/Bots/playerbot/strategy/actions/ChangeChatAction.h Adds action to change bot chat channel.
src/modules/Bots/playerbot/strategy/actions/ChangeChatAction.cpp Implements chat channel set/query.
src/modules/Bots/playerbot/strategy/actions/CastCustomSpellAction.h Adds action for casting arbitrary/custom spells.
src/modules/Bots/playerbot/strategy/actions/CastCustomSpellAction.cpp Implements custom spell parsing and cast attempt + feedback.
src/modules/Bots/playerbot/strategy/actions/BuyAction.h Adds buy-from-vendor action interface.
src/modules/Bots/playerbot/strategy/actions/BuyAction.cpp Implements vendor buying via BuyItemFromVendorSlot.
src/modules/Bots/playerbot/strategy/actions/BuffAction.h Adds action to list/identify usable buff consumables.
src/modules/Bots/playerbot/strategy/actions/BuffAction.cpp Implements buff item scanning and reporting.
src/modules/Bots/playerbot/strategy/actions/BankAction.h Adds bank deposit/withdraw/list action interface.
src/modules/Bots/playerbot/strategy/actions/BankAction.cpp Implements banker lookup + deposit/withdraw/list behavior.
src/modules/Bots/playerbot/strategy/actions/AttackAction.h Adds attack action base + specializations.
src/modules/Bots/playerbot/strategy/actions/AttackAction.cpp Implements attack initiation and target selection updates.
src/modules/Bots/playerbot/strategy/actions/AreaTriggerAction.h Adds area trigger follow/trigger actions.
src/modules/Bots/playerbot/strategy/actions/AreaTriggerAction.cpp Implements reach/execute area trigger mechanics.
src/modules/Bots/playerbot/strategy/actions/AddLootAction.h Adds actions to add loot targets to bot loot stack.
src/modules/Bots/playerbot/strategy/actions/AddLootAction.cpp Implements loot-stack additions (all/gathering).
src/modules/Bots/playerbot/strategy/actions/ActionContext.h Registers action creators used by the AI engine.
src/modules/Bots/playerbot/strategy/actions/AcceptResurrectAction.h Adds action to accept resurrect packets.
src/modules/Bots/playerbot/strategy/actions/AcceptQuestAction.h Adds quest accept/all accept + share accept actions.
src/modules/Bots/playerbot/strategy/actions/AcceptQuestAction.cpp Implements quest accept from selection/packet/share handling.
src/modules/Bots/playerbot/strategy/actions/AcceptInvitationAction.h Adds action to accept group invitation with security checks.
src/modules/Bots/playerbot/strategy/actions/AcceptDuelAction.h Adds action to accept duel packets.
src/modules/Bots/playerbot/strategy/Value.h Adds core AI value framework (calculated/manual values).
src/modules/Bots/playerbot/strategy/Value.cpp Adds translation unit for Value definitions.
src/modules/Bots/playerbot/strategy/Trigger.h Adds AI trigger base + TriggerNode wiring.
src/modules/Bots/playerbot/strategy/Trigger.cpp Implements trigger checking and target resolution.
src/modules/Bots/playerbot/strategy/Strategy.h Adds AI strategy base types and priorities.
src/modules/Bots/playerbot/strategy/Strategy.cpp Implements default action node factory and action lookup.
src/modules/Bots/playerbot/strategy/Queue.h Adds action basket queue interface.
src/modules/Bots/playerbot/strategy/Queue.cpp Implements relevance-based action selection queue.
src/modules/Bots/playerbot/strategy/PassiveMultiplier.h Adds passive-mode multiplier interface for action gating.
src/modules/Bots/playerbot/strategy/PassiveMultiplier.cpp Implements passive-mode allowlist/keyword matching.
src/modules/Bots/playerbot/strategy/Multiplier.h Adds multiplier base interface.
src/modules/Bots/playerbot/strategy/Multiplier.cpp Adds translation unit for multiplier base.
src/modules/Bots/playerbot/strategy/ExternalEventHelper.h Adds helper to route chat/packet events into triggers.
src/modules/Bots/playerbot/strategy/Event.h Adds Event wrapper for AI actions/triggers.
src/modules/Bots/playerbot/strategy/Event.cpp Implements event object GUID extraction from packets.
src/modules/Bots/playerbot/strategy/Engine.h Adds AI engine interface (strategies/triggers/multipliers).
src/modules/Bots/playerbot/strategy/AiObjectContext.h Adds context for strategies/triggers/actions/values.
src/modules/Bots/playerbot/strategy/AiObjectContext.cpp Wires context lists and update/reset behavior.
src/modules/Bots/playerbot/strategy/AiObject.h Adds base AI object types with bot/context/chat access.
src/modules/Bots/playerbot/strategy/AiObject.cpp Implements AiObject initialization and master resolution.
src/modules/Bots/playerbot/strategy/ActionBasket.h Adds placeholder header for ActionBasket (currently empty).
src/modules/Bots/playerbot/strategy/ActionBasket.cpp Adds placeholder translation unit for ActionBasket.
src/modules/Bots/playerbot/strategy/Action.h Adds core action graph types (Action/ActionNode/NextAction).
src/modules/Bots/playerbot/strategy/Action.cpp Implements NextAction helpers and action target resolution.
src/modules/Bots/playerbot/playerbotDefs.h Adds playerbot defs header placeholder.
src/modules/Bots/playerbot/playerbot.h Adds playerbot umbrella header + key game includes.
src/modules/Bots/playerbot/aiplayerbot.conf.dist.in Adds distribution config for playerbot/random bots.
src/modules/Bots/playerbot/RandomPlayerbotMgr.h Adds random-bot manager and holder integration.
src/modules/Bots/playerbot/RandomPlayerbotFactory.h Adds random-bot character factory interface.
src/modules/Bots/playerbot/README.md Adds playerbot module documentation and command reference.
src/modules/Bots/playerbot/PlayerbotSecurity.h Adds security policy for bot control/commands.
src/modules/Bots/playerbot/PlayerbotSecurity.cpp Implements security checks and denial feedback.
src/modules/Bots/playerbot/PlayerbotMgr.h Adds bot holder + per-master bot manager declarations.
src/modules/Bots/playerbot/PlayerbotFactory.h Adds bot randomize/refresh factory for gear/skills/spells.
src/modules/Bots/playerbot/PlayerbotAIConfig.h Adds playerbot/random bot configuration container.
src/modules/Bots/playerbot/PlayerbotAIBase.h Adds base AI update throttling/yield behavior.
src/modules/Bots/playerbot/PlayerbotAIBase.cpp Implements AI tick delay and pacing.
src/modules/Bots/playerbot/PlayerbotAIAware.h Adds AI pointer carrier base type.
src/modules/Bots/playerbot/PlayerbotAI.h Adds main AI facade + packet/chat handling declarations.
src/modules/Bots/playerbot/LootObjectStack.h Adds loot strategy enums and loot target stack.
src/modules/Bots/playerbot/LazyCalculatedValue.h Adds lazy evaluation helper for computed values.
src/modules/Bots/playerbot/Helpers.cpp Adds helper utilities (split/strstri/extractGuid).
src/modules/Bots/playerbot/FleeManager.h Adds flee point evaluation and destination selection types.
src/modules/Bots/playerbot/FleeManager.cpp Implements flee destination search and scoring.
src/modules/Bots/playerbot/ChatHelper.h Adds chat parsing/formatting helpers for bot commands.
src/modules/Bots/playerbot/ChatFilter.h Adds chat filter interfaces + composite filter.
src/modules/Bots/playerbot/AiFactory.h Adds AI engine/context factory interface.
src/modules/Bots/botpch.h Adds bot module PCH header for faster compile.
src/modules/Bots/botpch.cpp Adds bot module PCH translation unit.
src/modules/Bots/ahbot/TradeCategory.h Adds AH bot trade categories.
src/modules/Bots/ahbot/TradeCategory.cpp Adds AH bot trade category translation unit.
src/modules/Bots/ahbot/README.md Adds AH bot module documentation.
src/modules/Bots/ahbot/PricingStrategy.h Adds AH bot pricing strategies and factory.
src/modules/Bots/ahbot/ItemBag.h Adds category list + item bag containers.
src/modules/Bots/ahbot/ItemBag.cpp Implements item bag scanning/loading and auction inventory bags.
src/modules/Bots/ahbot/ConsumableCategory.h Adds AH bot consumable categories.
src/modules/Bots/ahbot/ConsumableCategory.cpp Adds AH bot consumable category translation unit.
src/modules/Bots/ahbot/Category.cpp Implements base category logic + quality wrappers.
src/modules/Bots/ahbot/AhBotConfig.h Adds AH bot configuration container and helpers.
src/modules/Bots/ahbot/AhBotConfig.cpp Implements config file loading and parameter parsing.
src/modules/Bots/ahbot/AhBot.h Adds AH bot main interface and state.
src/game/WorldHandlers/World.h Adds bot-related config enums and hooks.
src/game/WorldHandlers/World.cpp Loads bot configs, initializes bot modules, and updates bots per tick.
src/game/WorldHandlers/Spell.cpp Adds bot-guarded map validity check in Spell::finish.
src/game/WorldHandlers/Map.cpp Skips ResetMap() when removing bot players.
src/game/WorldHandlers/Group.h Adds GetTargetIcon accessor under playerbots.
src/game/WorldHandlers/ChatHandler.cpp Routes chat to bot command handlers under playerbots.
src/game/WorldHandlers/Chat.h Adds chat command handlers for bot/auctionbot commands.
src/game/WorldHandlers/Chat.cpp Registers bot, rndbot, auctionbot commands under playerbots.
src/game/WorldHandlers/CharacterHandler.cpp Adds async bot login query holder and playerbot manager wiring.
src/game/Server/WorldSession.cpp Fans out packets to bots, adds bot packet processing, and logout integration.
src/game/Object/Player.h Adds bot AI/manager pointers and accessors.
src/game/Object/Player.cpp Manages bot AI/manager lifetime + per-tick update + implements BuyItemFromVendor.
src/game/Object/Item.cpp Skips SendTimeUpdate for bots.
src/game/ChatCommands/AHBotCommands.cpp Adds compile-time include and a guard using AuctionHouseBot::Enabled().
src/game/CMakeLists.txt Adds bot module source groups and installs config templates.
src/game/AuctionHouseBot/AuctionHouseBot.h Adds Enabled() API for internal AH bot status.
src/game/AuctionHouseBot/AuctionHouseBot.cpp Uses Enabled() in Update() and implements Enabled().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +223 to 231
#ifdef ENABLE_PLAYERBOTS
CONFIG_UINT32_PLAYERBOT_MAXBOTS,
CONFIG_UINT32_PLAYERBOT_RESTRICTLEVEL,
CONFIG_UINT32_PLAYERBOT_MINBOTLEVEL,
#endif

CONFIG_BOOL_ENABLE_QUEST_TRACKER,
CONFIG_UINT32_AUTOBROADCAST_INTERVAL,
CONFIG_UINT32_VALUE_COUNT
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONFIG_BOOL_ENABLE_QUEST_TRACKER is placed inside enum eConfigUInt32Values, but it is a boolean config key (and is used as such in World.cpp). This will misalign config indices and can break config reads at runtime (or produce incorrect values) and/or fail compilation if setConfig expects a bool-enum. Move CONFIG_BOOL_ENABLE_QUEST_TRACKER back into enum eConfigBoolValues and keep eConfigUInt32Values strictly CONFIG_UINT32_* entries.

Copilot uses AI. Check for mistakes.
Comment on lines +30 to +39
void Queue::Push(ActionBasket **actions)
{
if (actions)
{
for (int i=0; i<sizeof(actions)/sizeof(ActionBasket*); i++)
{
Push(actions[i]);
}
}
}
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loop uses sizeof(actions) where actions is a pointer, so the computed length is not the number of elements (it will typically be 1 or 2 depending on platform). This will either push only the first element or read out of bounds. If these are intended to be null-terminated arrays (like NextAction** elsewhere), iterate until actions[i] == NULL; otherwise change the API to accept a std::vector<ActionBasket*> or (ActionBasket** actions, size_t count).

Copilot uses AI. Check for mistakes.
Comment on lines +90 to +101
void NextAction::destroy(NextAction** actions)
{
if (!actions)
{
return;
}

for (int i=0; i<10 && actions[i]; i++)
{
delete actions[i];
}
}
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NextAction::destroy deletes the elements but never frees the NextAction** array itself (new NextAction*[...] is used in clone, merge, and array). This leaks memory each time prerequisites/alternatives/continuers arrays are destroyed (e.g., in ActionNode destructor). After deleting elements, also delete[] actions; (and consider removing the hard-coded i<10 cap if arrays can exceed 10).

Copilot uses AI. Check for mistakes.
Comment on lines +139 to +141
file(GLOB Playerbot_Druid ${CMAKE_SOURCE_DIR}/src/modules/Bots/playerbot/strategy/deathknight/*.cpp ${CMAKE_SOURCE_DIR}/src/modules/Bots/playerbot/strategy/deathknight/*.h)
source_group("Player Bot\\Strategies\\Druid" FILES ${Playerbot_Death_Knight})
LIST(APPEND SRC_GRP_BOTS ${Playerbot_Death_Knight})
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Death Knight glob is assigned to Playerbot_Druid, but the source_group/LIST(APPEND ...) refer to Playerbot_Death_Knight (which isn’t defined here). This will cause CMake configuration errors and/or omit the Death Knight sources from the build. Use a consistent variable name (e.g., Playerbot_DeathKnight) and a correct source_group path (e.g., Player Bot\\Strategies\\DeathKnight).

Suggested change
file(GLOB Playerbot_Druid ${CMAKE_SOURCE_DIR}/src/modules/Bots/playerbot/strategy/deathknight/*.cpp ${CMAKE_SOURCE_DIR}/src/modules/Bots/playerbot/strategy/deathknight/*.h)
source_group("Player Bot\\Strategies\\Druid" FILES ${Playerbot_Death_Knight})
LIST(APPEND SRC_GRP_BOTS ${Playerbot_Death_Knight})
file(GLOB Playerbot_DeathKnight ${CMAKE_SOURCE_DIR}/src/modules/Bots/playerbot/strategy/deathknight/*.cpp ${CMAKE_SOURCE_DIR}/src/modules/Bots/playerbot/strategy/deathknight/*.h)
source_group("Player Bot\\Strategies\\DeathKnight" FILES ${Playerbot_DeathKnight})
LIST(APPEND SRC_GRP_BOTS ${Playerbot_DeathKnight})

Copilot uses AI. Check for mistakes.
Comment on lines +451 to +457
#ifdef ENABLE_PLAYERBOTS
if (GetPlayer()->GetPlayerbotMgr())
{
GetPlayer()->GetPlayerbotMgr()->LogoutAllBots();
}
#endif

Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LogoutAllBots() is invoked twice during the same logout flow when ENABLE_PLAYERBOTS is enabled (once via GetPlayer() and again via _player). This is redundant and can lead to double-processing (and potentially double-logout side effects depending on implementation). Keep a single call (preferably against _player) and remove the duplicate block.

Suggested change
#ifdef ENABLE_PLAYERBOTS
if (GetPlayer()->GetPlayerbotMgr())
{
GetPlayer()->GetPlayerbotMgr()->LogoutAllBots();
}
#endif

Copilot uses AI. Check for mistakes.
#include "botpch.h"
#include "../../playerbot.h"
#include "EmoteAction.h"

Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same emote keys are assigned multiple times (dance, roar), so earlier values are overwritten and never used. If that’s unintended, remove duplicates or rename keys (e.g., separate dance vs dance_state, roar vs roar_state) so user input maps deterministically.

Copilot uses AI. Check for mistakes.
emotes["ready1h"] = EMOTE_ONESHOT_READY1H;
emotes["readybow"] = EMOTE_ONESHOT_READYBOW;
emotes["readyunarmed"] = EMOTE_ONESHOT_READYUNARMED;
emotes["roar"] = EMOTE_ONESHOT_ROAR;
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same emote keys are assigned multiple times (dance, roar), so earlier values are overwritten and never used. If that’s unintended, remove duplicates or rename keys (e.g., separate dance vs dance_state, roar vs roar_state) so user input maps deterministically.

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,101 @@
# Player Bot Module

The Playerbot module integrates with Mangos to provide user-controll AI characters for groups and raids. This is especially helpful on low-activity servers.
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typos in documentation to improve clarity: 'user-controll' → 'user-controlled', 'Decription' → 'Description', 'someting' → 'something', 'enlist' → 'list', 'stategies' → 'strategies'.

Copilot uses AI. Check for mistakes.

**HINT**: you can create key-binded macros for any of this command for quick usage, e.g.

| Key | Macro | Decription |
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typos in documentation to improve clarity: 'user-controll' → 'user-controlled', 'Decription' → 'Description', 'someting' → 'something', 'enlist' → 'list', 'stategies' → 'strategies'.

Copilot uses AI. Check for mistakes.

*/p* can be replaced with */r* if you are in raid group.

To learn about other commands tell bot someting invalid and it will enlist all the commands and stategies available. No newline at end of file
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix typos in documentation to improve clarity: 'user-controll' → 'user-controlled', 'Decription' → 'Description', 'someting' → 'something', 'enlist' → 'list', 'stategies' → 'strategies'.

Copilot uses AI. Check for mistakes.
Copilot AI added a commit that referenced this pull request Mar 2, 2026
Co-authored-by: billy1arm <2219118+billy1arm@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants