Repository navigation
Conversation
- Removed action repository restriction
There was a problem hiding this comment.
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::maxMaskfrom 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
maxMaskvalue is being set to 256, but the highest defined flag isfood = 64. According to the usage inCheatAction.cppwherelog2(maxMask)is used to iterate through flags,maxMaskshould 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.
There was a problem hiding this comment.
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.
| raid = 32, | ||
| food = 64, | ||
| maxMask = 128 | ||
| maxMask = 256 |
There was a problem hiding this comment.
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.
| maxMask = 256 | |
| maxMask = 128 |
No description provided.