Conversation
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Damage.cpppart of the closed bugfix(saveload): Fix silent crash loading old saves under RETAIL_COMPATIBLE_XFER_SAVE=0 #2922DamageInfoInput::xfercheckscurrentVersionbefore readingm_kill:currentVersionis 1 in a retail compatible Generals build and 3 otherwise. A Generals build with retail compatibility off reads a byte that a version 1 record does not have, and every field after it is off by one.ActiveBody::xfertransfers aDamageInfofor every object, so the load dies on the first one.Now it checks
version. Them_damageFXOverrideread above it and the version 3 block below it already do. Save output does not change,versionandcurrentVersionare equal when saving.Measured on USA01. Saved at frame 1903 with a retail compatible build, then loaded that save with a build configured
RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME=OFF, once before and once after this change. The retail compatible build writes version 1 damage records, same as retail 1.08.Before the change the load hits an access violation on
Xfer Object GLATankScorpion id=2363, the first object in the file. After it, all 3781 objects load and the game runs on to frame 2100 and saves again. Same tree, same build directory, this line is the only difference between the two exes.Zero Hour saves are always version 3, so nothing changes there.
Todo: