-
Notifications
You must be signed in to change notification settings - Fork 174
Description
Prerequisites
- I have searched for similar issues and confirmed this is not a duplicate
Game Version
- Command & Conquer Generals
- Command & Conquer Generals: Zero Hour
- Other (please specify below)
Bug Description
File GeneralsGameCode\GeneralsMD\Code\GameEngine\Source\GameLogic\AI\AIGroup.cpp
In AIGroup::groupMoveToPosition(), the tightenGroup size check incorrectly reuses the X span for both axes:
dy is computed from max.x - min.x instead of max.y - min.y.
This causes cells to be calculated as width² rather than width * height, so groupTightenToPosition() can be triggered or skipped based on group orientation instead of actual group size.
GeneralsGameCode/GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIGroup.cpp
Lines 1661 to 1673 in 39647c3
| if (tightenGroup) | |
| { | |
| isFormation = false; | |
| if (!addWaypoint) { | |
| Int dx = (max.x-min.x)/PATHFIND_CELL_SIZE_F; | |
| Int dy = (max.x-min.x)/PATHFIND_CELL_SIZE_F; | |
| Int cells = (dx*dy); | |
| if (cells<2000) { | |
| groupTightenToPosition(pos, false, cmdSource); | |
| return; | |
| } | |
| } | |
| } |
Maybbe instead ?
Int dx = (max.x - min.x) / PATHFIND_CELL_SIZE_F;
Int dy = (max.y - min.y) / PATHFIND_CELL_SIZE_F;
Int cells = dx * dy;I'll leave it up to
Reproduction Steps
I have not yet been able to visually reproduce this in a player-visible way gameplay scenario.
So this bug is confirmed at the code level and logging shows that the tightenGroup logic is active for normal player movement commands.
Additional Context
No response