Skip to content

Commit fdb318e

Browse files
committed
refactor: Make millisecond variables conditional in ParticleUplinkCannon retail builds
1 parent dc2d899 commit fdb318e

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

GeneralsMD/Code/GameEngine/Include/GameLogic/Module/ParticleUplinkCannonUpdate.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,13 @@ class ParticleUplinkCannonUpdate : public SpecialPowerUpdateModule
227227
UnsignedInt m_nextDamagePulseFrame;
228228
UnsignedInt m_startAttackFrame;
229229
UnsignedInt m_startDecayFrame;
230-
#if RETAIL_COMPATIBLE_XFER_SAVE
231-
UnsignedInt m_lastDrivingClickFrame; // Frame number for retail compatibility
230+
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_XFER_SAVE
231+
UnsignedInt m_lastDrivingClickFrame; // Frame number for retail compatibility
232232
UnsignedInt m_2ndLastDrivingClickFrame; // Frame number for retail compatibility
233-
#endif
233+
#else
234234
UnsignedInt m_lastDrivingClickTimeMsec; // Real-time milliseconds
235235
UnsignedInt m_2ndLastDrivingClickTimeMsec; // Real-time milliseconds
236+
#endif
236237
UnsignedInt m_nextDestWaypointID;
237238

238239
Bool m_upBonesCached;

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

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,13 @@ ParticleUplinkCannonUpdate::ParticleUplinkCannonUpdate( Thing *thing, const Modu
184184
m_nextDamagePulseFrame = 0;
185185
m_startAttackFrame = 0;
186186
m_startDecayFrame = 0;
187-
#if RETAIL_COMPATIBLE_XFER_SAVE
187+
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_XFER_SAVE
188188
m_lastDrivingClickFrame = 0;
189189
m_2ndLastDrivingClickFrame = 0;
190-
#endif
190+
#else
191191
m_lastDrivingClickTimeMsec = 0;
192192
m_2ndLastDrivingClickTimeMsec = 0;
193+
#endif
193194
m_clientShroudedLastFrame = FALSE;
194195

195196
for( Int i = 0; i < MAX_OUTER_NODES; i++ )
@@ -378,12 +379,13 @@ void ParticleUplinkCannonUpdate::setSpecialPowerOverridableDestination( const Co
378379
{
379380
m_overrideTargetDestination = *loc;
380381
m_manualTargetMode = TRUE;
381-
#if RETAIL_COMPATIBLE_XFER_SAVE
382+
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_XFER_SAVE
382383
m_2ndLastDrivingClickFrame = m_lastDrivingClickFrame;
383384
m_lastDrivingClickFrame = TheGameLogic->getFrame();
384-
#endif
385+
#else
385386
m_2ndLastDrivingClickTimeMsec = m_lastDrivingClickTimeMsec;
386387
m_lastDrivingClickTimeMsec = timeGetTime();
388+
#endif
387389
}
388390
}
389391

@@ -1516,19 +1518,11 @@ void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
15161518
m_startDecayFrame = m_startAttackFrame + data->m_totalFiringFrames;
15171519
}
15181520

1519-
// the time of last manual target click (milliseconds)
1520-
#if RETAIL_COMPATIBLE_XFER_SAVE
1521+
// the time of last manual target click
1522+
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_XFER_SAVE
15211523
// Retail builds stay at version 3 for compatibility, so always use old frame format
15221524
xfer->xferUnsignedInt( &m_lastDrivingClickFrame );
15231525
xfer->xferUnsignedInt( &m_2ndLastDrivingClickFrame );
1524-
#if !RETAIL_COMPATIBLE_CRC
1525-
if( xfer->getXferMode() == XFER_LOAD )
1526-
{
1527-
// Can't convert frames to milliseconds accurately, so set to 0
1528-
m_lastDrivingClickTimeMsec = 0;
1529-
m_2ndLastDrivingClickTimeMsec = 0;
1530-
}
1531-
#endif
15321526
#else
15331527
if( version >= 5 )
15341528
{

0 commit comments

Comments
 (0)