Skip to content

fix(saveload): Check version instead of currentVersion in xfer methods - #3300

Draft
bobtista wants to merge 1 commit into
TheSuperHackers:mainfrom
bobtista:bobtista/fix/xfer-version-checks
Draft

bobtista wants to merge 1 commit into
TheSuperHackers:mainfrom
bobtista:bobtista/fix/xfer-version-checks

Conversation

@bobtista

@bobtista bobtista commented Sep 15, 2026

Copy link
Copy Markdown

InGameUI::xfer, CountermeasuresBehavior::xfer and GameStateMap::xfer compare currentVersion against the version a field was added in:

if( currentVersion >= 2 )
{
    xfer->xferSTLObjectIDVector( &m_counterMeasures );
    ...
}

currentVersion is a constant, so this is always true and the code for older versions never runs. InGameUI has an else that falls back to ready for the EVA flag. It is dead.

Now all three check version. Save output does not change, version and currentVersion are equal when saving.

Retail wrote version 3 for InGameUI and version 2 for the other two. Every real save already takes these branches and loads exactly as before. Nothing user facing changes, the reads now match the version comments above them.

DamageInfoInput::xfer is the sixth site from the issue. That one crashes, so it has its own issue and pull, #3299.

Todo:

  • No currentVersion >= comparisons left in Core, Generals or GeneralsMD
  • Zero Hour saves and loads as before
  • Replicate to Generals — GameStateMap only, the other two files are Zero Hour only

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.

Xfer: check against version variable not currentVersion

1 participant