Skip to content

bugfix(saveload): Restore pending path requests after loading - #3491

Draft
bobtista wants to merge 3 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/requeue-path-after-load
Draft

bobtista wants to merge 3 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/requeue-path-after-load

Conversation

@bobtista

@bobtista bobtista commented Oct 12, 2026 •

Copy link
Copy Markdown

AIUpdateInterface::xfer saves m_waitingForPath, but Pathfinder::xfer does not save the pathfind queue. A unit saved while its request sits in the queue loads with the flag set and no queue entry, so the request is never serviced and the unit stands still.

Now AIUpdateInterface::loadPostProcess queues the request again when the unit is waiting for a path. Requests delayed by m_queueForPathFrame are left alone, because AIUpdateInterface::update already queues them when that frame arrives. The queue order after a load follows the object load order, not the original order.

Todo:

  • Save a skirmish at a frame where a unit is queued for a path and load it: before the fix the unit is still waiting with no path 560 frames later, after the fix it gets its path
  • Older saves still load
  • Replicate to Generals

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8515d1c6-a3fa-403e-a11f-0ec0ae1bcffc
📥 Commits

Reviewing files that changed from the base of the PR and between b9acc77 and a34dd98.

📒 Files selected for processing (1)
  • Generals/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.

Walkthrough

loadPostProcess now requeues a pending path request when m_waitingForPath is true and m_queueForPathFrame is zero.

Changes

Path Request Restore

Layer / File(s) Summary
Post-load path requeue
Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp, GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate.cpp
loadPostProcess queues the object for pathfinding when a path request is pending and no delayed queue frame is recorded.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: caball009

Merge Risk: ⚪ Minimal · up to a34dd

No unresolved issue is established in the reviewed changes; the pending-path restoration is present in both game variants.

Pre-merge checks · Passed 4
Passed Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main change: restoring pending path requests after save/load.
Description check Passed The description directly explains the save/load bug, the requeue behavior, delayed requests, testing results, and replication status.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a8939d73-1259-4fb8-a381-d1d77228e8e6
📥 Commits

Reviewing files that changed from the base of the PR and between 0e6a06c and b9acc77.

📒 Files selected for processing (1)
  • GeneralsMD/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; 2 remain after this review.

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.

1 participant