Repository navigation
bugfix(ai): Fix checkForCrateToPickup never returning the created crate - #3481
WebbontheWeb wants to merge 1 commit into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughGenerals and Zero Hour now use build-specific ordering for the recorded crate ID reset and crate lookup in ChangesCrate pickup handling
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change is limited to the intended crate pickup correction and does not introduce an established merge-blocking risk. Pre-merge checks |
|
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Retain the fallback for blocked in-range positions. · AIUpdate.cpp:3418-3422
Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp:3418-3422
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRetain the fallback for blocked in-range positions.
When the attack position is in range but its attack view is blocked, the current non-retail guard skips
findPositionAround.computeAttackPaththen tries to path to the exact unreachable position and can fail. A nearby position returned byfindPositionAroundcan provide a reachable, clear attack position.Keep the range optimization only when the attack view is clear in both editions.
Suggested fix
-if (weapon && weapon->isContactWeapon() && !weapon->isWithinAttackRange(getObject(), &localPos) && !isPathAvailable(&localPos)) +if (weapon && weapon->isContactWeapon() && + (!weapon->isWithinAttackRange(getObject(), &localPos) || + (isDoingGroundMovement() && + TheAI->pathfinder()->isAttackViewBlockedByObstacle( + getObject(), *getObject()->getPosition(), nullptr, localPos))) && + !isPathAvailable(&localPos))Apply the same change in
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
c535d213-a6b4-4625-a0b9-d1f75c8165ad
📒 Files selected for processing (2)
Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cppGeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
98e71bb to
bcd2da6
Compare
…ing the created crate
bcd2da6 to
d1014b0
Compare
Updates
AIUpdateInterface::checkForCrateToPickupto search for crates before clearing their id, allowing units to correctly pickup crates. Since this updates AI behavior, it's turned off withRETAIL_COMPATIBLE_CRC.Before update - both guard and idle units ignore the crate
beforesalvagefix.mp4
After update - both guard and idle units persue the crate
aftersalvagefix.mp4
Map:
SalvagePickup.zip
All replays ran successfully.