Skip to content

Commit 99e68e1

Browse files
committed
remove xfer of timeGetTime values and fix xfer version numbering
1 parent 12b2f8d commit 99e68e1

File tree

2 files changed

+16
-36
lines changed

2 files changed

+16
-36
lines changed

Generals/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,9 +1332,8 @@ void ParticleUplinkCannonUpdate::crc( Xfer *xfer )
13321332
* Version Info:
13331333
* 1: Initial version
13341334
* 2: Serialize decay frames
1335-
* 3: TheSuperHackers @tweak Added m_manualTargetMode
1336-
* 4: TheSuperHackers @tweak Added m_orbitToTargetLaserRadius
1337-
* 5: TheSuperHackers @tweak Changed m_lastDrivingClickFrame to m_lastDrivingClickTimeMsec (frames to milliseconds)
1335+
* 3: TheSuperHackers @tweak Serialize manual target mode
1336+
* 4: TheSuperHackers @tweak Serialize orbit to target laser radius
13381337
*/
13391338
// ------------------------------------------------------------------------------------------------
13401339
void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
@@ -1345,7 +1344,7 @@ void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
13451344
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_XFER_SAVE
13461345
const XferVersion currentVersion = 2;
13471346
#else
1348-
const XferVersion currentVersion = 5;
1347+
const XferVersion currentVersion = 4;
13491348
#endif
13501349
XferVersion version = currentVersion;
13511350
xfer->xferVersion( &version, currentVersion );
@@ -1444,29 +1443,20 @@ void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
14441443

14451444
// the time of last manual target click
14461445
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_XFER_SAVE
1447-
// Retail builds stay at version 3 for compatibility, so always use old frame format
14481446
xfer->xferUnsignedInt( &m_lastDrivingClickFrame );
14491447
xfer->xferUnsignedInt( &m_2ndLastDrivingClickFrame );
14501448
#else
1451-
if( version >= 5 )
1452-
{
1453-
xfer->xferUnsignedInt( &m_lastDrivingClickTimeMsec );
1454-
xfer->xferUnsignedInt( &m_2ndLastDrivingClickTimeMsec );
1455-
}
1456-
else
1457-
{
1458-
// Old versions stored frame numbers, read and discard to advance file position.
1459-
UnsignedInt oldLastDrivingClickFrame = 0;
1460-
UnsignedInt old2ndLastDrivingClickFrame = 0;
1461-
xfer->xferUnsignedInt( &oldLastDrivingClickFrame );
1462-
xfer->xferUnsignedInt( &old2ndLastDrivingClickFrame );
1463-
}
1464-
#endif
1449+
// TheSuperHackers @info timeGetTime values are machine-relative and meaningless on load.
1450+
// Write/read dummy values to maintain file format compatibility.
1451+
UnsignedInt dummyClickTime = 0;
1452+
xfer->xferUnsignedInt( &dummyClickTime );
1453+
xfer->xferUnsignedInt( &dummyClickTime );
14651454

14661455
if( version >= 3 )
14671456
{
14681457
xfer->xferBool( &m_manualTargetMode );
14691458
}
1459+
#endif
14701460

14711461
if( version >= 4 )
14721462
{

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/ParticleUplinkCannonUpdate.cpp

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,8 +1417,7 @@ void ParticleUplinkCannonUpdate::crc( Xfer *xfer )
14171417
* 1: Initial version
14181418
* 2: Serialize decay frames
14191419
* 3: Serialize scripted waypoints (Added for Zero Hour)
1420-
* 4: TheSuperHackers @tweak Added m_orbitToTargetLaserRadius
1421-
* 5: TheSuperHackers @tweak Changed m_lastDrivingClickFrame to m_lastDrivingClickTimeMsec (frames to milliseconds)
1420+
* 4: TheSuperHackers @tweak Serialize orbit to target laser radius
14221421
*/
14231422
// ------------------------------------------------------------------------------------------------
14241423
void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
@@ -1429,7 +1428,7 @@ void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
14291428
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_XFER_SAVE
14301429
const XferVersion currentVersion = 3;
14311430
#else
1432-
const XferVersion currentVersion = 5;
1431+
const XferVersion currentVersion = 4;
14331432
#endif
14341433
XferVersion version = currentVersion;
14351434
xfer->xferVersion( &version, currentVersion );
@@ -1528,23 +1527,14 @@ void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
15281527

15291528
// the time of last manual target click
15301529
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_XFER_SAVE
1531-
// Retail builds stay at version 3 for compatibility, so always use old frame format
15321530
xfer->xferUnsignedInt( &m_lastDrivingClickFrame );
15331531
xfer->xferUnsignedInt( &m_2ndLastDrivingClickFrame );
15341532
#else
1535-
if( version >= 5 )
1536-
{
1537-
xfer->xferUnsignedInt( &m_lastDrivingClickTimeMsec );
1538-
xfer->xferUnsignedInt( &m_2ndLastDrivingClickTimeMsec );
1539-
}
1540-
else
1541-
{
1542-
// Old versions stored frame numbers, read and discard to advance file position.
1543-
UnsignedInt oldLastDrivingClickFrame = 0;
1544-
UnsignedInt old2ndLastDrivingClickFrame = 0;
1545-
xfer->xferUnsignedInt( &oldLastDrivingClickFrame );
1546-
xfer->xferUnsignedInt( &old2ndLastDrivingClickFrame );
1547-
}
1533+
// TheSuperHackers @info timeGetTime values are machine-relative and meaningless on load.
1534+
// Write/read dummy values to maintain file format compatibility.
1535+
UnsignedInt dummyClickTime = 0;
1536+
xfer->xferUnsignedInt( &dummyClickTime );
1537+
xfer->xferUnsignedInt( &dummyClickTime );
15481538
#endif
15491539

15501540
if( version >= 3 )

0 commit comments

Comments
 (0)