A Generals build with RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME=OFF crashes on the first object when it loads a save written by retail 1.08 or by a retail compatible build.
DamageInfoInput::xfer checks currentVersion where it should check version:
|
// kill no matter what (old versions default to FALSE). |
|
if( currentVersion >= 2 ) |
|
{ |
|
xfer->xferBool( &m_kill ); |
|
} |
currentVersion is 1 under RTS_GENERALS && RETAIL_COMPATIBLE_XFER_SAVE and 3 otherwise. With compatibility off it is 3, so the load reads a m_kill byte that a version 1 record does not have. Everything after it is off by one. ActiveBody::xfer transfers a DamageInfo for every object, so the first object with a body crashes the load.
Original Generals never wrote m_kill. #2141 brought the line over from Zero Hour, where retail 1.04 always wrote version 3 and the check is always true.
Repro:
- Build Generals with default options, start a mission, save
- Build Generals with
-DRTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME=OFF
- Load that save
Access violation in CHUNK_GameLogic on the first Xfer Object line in the log.
This is one of the six sites in #3297. It crashes and the other five do not, so it gets its own issue. The closed #2922 included the same line in a larger change.
A Generals build with
RTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME=OFFcrashes on the first object when it loads a save written by retail 1.08 or by a retail compatible build.DamageInfoInput::xfercheckscurrentVersionwhere it should checkversion:GeneralsGameCode/Core/GameEngine/Source/GameLogic/System/Damage.cpp
Lines 155 to 159 in bfa3bbf
currentVersionis 1 underRTS_GENERALS && RETAIL_COMPATIBLE_XFER_SAVEand 3 otherwise. With compatibility off it is 3, so the load reads am_killbyte that a version 1 record does not have. Everything after it is off by one.ActiveBody::xfertransfers aDamageInfofor every object, so the first object with a body crashes the load.Original Generals never wrote
m_kill. #2141 brought the line over from Zero Hour, where retail 1.04 always wrote version 3 and the check is always true.Repro:
-DRTS_BUILD_OPTION_RETAIL_COMPATIBLE_GAME=OFFAccess violation in
CHUNK_GameLogicon the firstXfer Objectline in the log.This is one of the six sites in #3297. It crashes and the other five do not, so it gets its own issue. The closed #2922 included the same line in a larger change.