Skip to content

bugfix(saveload): Preserve pending idle weapon reloads - #3492

Draft
bobtista wants to merge 2 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/firing-tracker-force-reload-xfer
Draft

bobtista wants to merge 2 commits into
TheSuperHackers:mainfrom
bobtista:bobtista/bugfix/firing-tracker-force-reload-xfer

Conversation

@bobtista

@bobtista bobtista commented Oct 12, 2026 •

Copy link
Copy Markdown

FiringTracker::xfer does not save m_frameToForceReload. After a load it is 0, which disables the timer, so a weapon with AutoReloadWhenIdle (Rocket Buggy, Comanche missiles) loses the idle reload it had scheduled before the save. The next shot schedules a new one.

Now version 2 saves m_frameToForceReload. Builds with RETAIL_COMPATIBLE_XFER_SAVE still write version 1 without the timer. The test above used a build with it set to 0 and a newly written version 2 save. Older saves still load with the timer at 0.

Todo:

  • Save a skirmish with five weapons waiting on an idle reload and load it: before the fix none of them reload, after the fix the deadlines are restored and the reloads fire on the saved frames
  • 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: dcc665e7-ef4b-4d94-8afb-530a2aae91f6

📥 Commits

Reviewing files that changed from the base of the PR and between c6012d6 and 45b047a.


📒 Files selected for processing (1)
  • Generals/Code/GameEngine/Source/GameLogic/Object/FiringTracker.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.



Walkthrough

FiringTracker::xfer selects a save transfer version based on retail compatibility. It transfers m_frameToForceReload only when the loaded transfer version is 2 or later.

Changes

FiringTracker save transfer

Layer / File(s) Summary
Versioned reload-frame transfer
GeneralsMD/Code/GameEngine/Source/GameLogic/Object/FiringTracker.cpp, Generals/Code/GameEngine/Source/GameLogic/Object/FiringTracker.cpp
Retail-compatible saves use transfer version 1. Other saves use version 2. The function transfers m_frameToForceReload only for loaded version 2 or later.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 45b04

Non-retail-compatible saves now retain pending idle reloads across loading in both variants. Retail-compatible saves keep the version-1 format and its existing limitation; no actionable merge-blocking risk is established.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description check Passed The description clearly explains the save/load bug, the version 2 fix, compatibility behavior, and test status.
Title check Passed The title clearly and concisely identifies the main change: preserving pending idle weapon reloads during save/load.
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.

  • 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.

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