Skip to content

- test - #38

Closed
kadeshar wants to merge 8 commits into
masterfrom
codestyle-azerothcore
Closed

kadeshar wants to merge 8 commits into
masterfrom
codestyle-azerothcore

Conversation

@kadeshar

@kadeshar kadeshar commented Nov 1, 2025

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings November 1, 2025 21:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the maxMask value in the BotCheatMask enum from 128 to 256 and adds a blank line at the end of a workflow file. The change to maxMask appears to accommodate future expansion of the bitmask enum beyond the current 7 flags (0-64).

  • Changed BotCheatMask::maxMask from 128 to 256
  • Added trailing newline to codestyle workflow file

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/PlayerbotAIConfig.h Updates maxMask constant from 128 to 256 to allow for additional cheat flags
.github/workflows/codestyle_cpp.yml Adds trailing newline for file formatting consistency
Comments suppressed due to low confidence (1)

src/PlayerbotAIConfig.h:1

  • The maxMask value is being set to 256, but the highest defined flag is food = 64. According to the usage in CheatAction.cpp where log2(maxMask) is used to iterate through flags, maxMask should be the next power of 2 after the last flag, which is 128 (2^7). Changing it to 256 will cause the loop to iterate 8 times instead of 7, potentially accessing an undefined flag at bit position 7 (value 128).
/*

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

Copilot AI review requested due to automatic review settings November 1, 2025 21:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.


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

Comment thread src/PlayerbotAIConfig.h
raid = 32,
food = 64,
maxMask = 128
maxMask = 256

Copilot AI Nov 1, 2025

Copy link

Choose a reason for hiding this comment

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

The maxMask value should be 128, not 256. The enum uses a bit flag pattern where the highest actual flag is food = 64 (bit 6). The maxMask should represent one past the highest bit, which is 128 (2^7). Setting it to 256 will cause the loop in CheatAction.cpp:86 (for (int i = 0; i < log2((uint32)BotCheatMask::maxMask); i++)) to iterate 8 times instead of 7, potentially accessing an undefined flag value. If a new flag at bit 7 (value 128) is intended to be added, it should be explicitly defined in the enum.

Suggested change
maxMask = 256
maxMask = 128

Copilot uses AI. Check for mistakes.
@kadeshar kadeshar closed this Nov 6, 2025
@kadeshar
kadeshar deleted the codestyle-azerothcore branch March 22, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants