Skip to content

Commit 04ebb42

Browse files
committed
compat: add RETAIL_COMPATIBLE_CRC flag for BitFlags sizeof fix
1 parent 68a637b commit 04ebb42

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Generals/Code/GameEngine/Include/Common/BitFlagsIO.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,13 @@ void BitFlags<NUMBITS>::xfer(Xfer* xfer)
214214
{
215215

216216
// just call the xfer implementation on the data values
217+
// TheSuperHackers @bugfix bobtista 05/12/2025 Fix sizeof(this) bug
218+
// Original code used sizeof(this) which is pointer size
219+
#ifndef RETAIL_COMPATIBLE_CRC
217220
xfer->xferUser( this, sizeof( *this ) );
221+
#else
222+
xfer->xferUser( this, sizeof( this ) );
223+
#endif
218224

219225
}
220226
else

GeneralsMD/Code/GameEngine/Include/Common/BitFlagsIO.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,13 @@ void BitFlags<NUMBITS>::xfer(Xfer* xfer)
214214
{
215215

216216
// just call the xfer implementation on the data values
217+
// TheSuperHackers @bugfix bobtista 05/12/2025 Fix sizeof(this) bug
218+
// Original code used sizeof(this) which is pointer size
219+
#ifndef RETAIL_COMPATIBLE_CRC
217220
xfer->xferUser( this, sizeof( *this ) );
221+
#else
222+
xfer->xferUser( this, sizeof( this ) );
223+
#endif
218224

219225
}
220226
else

0 commit comments

Comments
 (0)