Skip to content

bugfix(saveload): Restore dock approach flags when loading in DockUpdate::xfer() - #3117

Merged
xezon merged 6 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/dockupdate-approach-position-reached
Sep 24, 2026
Merged

xezon merged 6 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/dockupdate-approach-position-reached

Conversation

@bobtista

@bobtista bobtista commented Aug 12, 2026 •

Copy link
Copy Markdown

Fixes #3116.

DockUpdate::xfer loads each approach reached flag into a temporary
Bool but never copies it back into the vector. Write it back so the
saved flags are restored. The save format is unchanged.

Verified on MD_CHI01 and a skirmish with multiple supply queues:
1000000000 loaded as 0000000000 before the fix and
1000000000 after it. Slot owners were preserved in both cases.
The queues recovered without the fix; this restores the saved state.

Related: #3151 fixes a separate field in the same function.

@bobtista
bobtista force-pushed the bobtista/bugfix/dockupdate-approach-position-reached branch from 9037f30 to 7f5465a Compare August 27, 2026 16:30
@bobtista
bobtista force-pushed the bobtista/bugfix/dockupdate-approach-position-reached branch from 7f5465a to 90633c2 Compare September 14, 2026 21:06
@bobtista bobtista changed the title bugfix(saveload): Restore dock approach position reached flags on load bugfix(saveload): Restore dock approach flags on load Sep 14, 2026
@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

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: a7acf012-a80a-42f2-8c8d-50d2bd3a3534

📥 Commits

Reviewing files that changed from the base of the PR and between a1c545e and 192f0ae.

📒 Files selected for processing (1)
  • Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/DockUpdate.cpp
💤 Files with no reviewable changes (1)
  • Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/DockUpdate.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


Walkthrough

DockUpdate::xfer writes each transferred approach-position flag back to m_approachPositionReached in GeneralsMD. In Generals, the assignment remains unchanged and its explanatory comment was removed.

Changes

Dock approach flag restoration

Layer / File(s) Summary
Restore serialized approach flags
Generals/.../DockUpdate.cpp, GeneralsMD/.../DockUpdate.cpp
GeneralsMD writes each transferred flag back into m_approachPositionReached. Generals retains its existing assignment and removes the associated comment.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: caball009

Merge Risk: ⚪ Minimal · up to 192f0

The save/load change restores dock approach state without altering the save format or slot ownership. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed For issue #3116, both Generals and GeneralsMD now assign the value returned by xferBool to m_approachPositionReached[vectorIndex]. This restores each serialized reached flag and preserves the …
Out of Scope Changes check ✅ Passed The whole-PR diff contains only the targeted reached-flag assignments in the two DockUpdate::xfer implementations. These changes directly implement issue #3116. The separate #3151 field is not chang…
Title check ✅ Passed The title clearly identifies the bug fix and the affected function, DockUpdate::xfer. It accurately summarizes the restoration of dock approach flags during save loading.
Description check ✅ Passed The description directly explains the missing flag assignment, the unchanged save format, verification results, and the related issue scope. It is relevant to the changeset.

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

@bobtista
bobtista marked this pull request as ready for review September 22, 2026 20:01
@greptile-apps

greptile-apps Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge because the transferred flags are now restored consistently in both implementations without altering serialization layout.

Summary

Restores serialized dock-approach flags when loading saved games without changing the save format.

  • Copies each value transferred through the temporary Bool back into m_approachPositionReached.
  • Applies the same correction to the Generals and Zero Hour implementations.

Reviews (2) · Last reviewed commit: "chore(dock): Remove redundant approach f..."

Comment thread Generals/Code/GameEngine/Source/GameLogic/Object/Update/DockUpdate/DockUpdate.cpp Outdated
@bobtista bobtista self-assigned this Sep 23, 2026
@bobtista bobtista added Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker labels Sep 23, 2026
@bobtista bobtista added the Saveload Is Saveload/Xfer related label Sep 23, 2026

@Caball009 Caball009 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.

Looks reasonable.

@xezon xezon changed the title bugfix(saveload): Restore dock approach flags on load bugfix(saveload): Restore dock approach flags when loading in DockUpdate::xfer() Sep 24, 2026
@xezon
xezon merged commit 5da0688 into TheSuperHackers:main Sep 24, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something is not working right, typically is user facing Minor Severity: Minor < Major < Critical < Blocker Saveload Is Saveload/Xfer related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dock approach reached flags are not restored when loading a save

3 participants