@@ -183,8 +183,13 @@ ParticleUplinkCannonUpdate::ParticleUplinkCannonUpdate( Thing *thing, const Modu
183183 m_nextDamagePulseFrame = 0 ;
184184 m_startAttackFrame = 0 ;
185185 m_startDecayFrame = 0 ;
186+ #if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_XFER_SAVE
186187 m_lastDrivingClickFrame = 0 ;
187188 m_2ndLastDrivingClickFrame = 0 ;
189+ #else
190+ m_lastDrivingClickTimeMsec = 0 ;
191+ m_2ndLastDrivingClickTimeMsec = 0 ;
192+ #endif
188193 m_clientShroudedLastFrame = FALSE ;
189194
190195 for ( Int i = 0 ; i < MAX_OUTER_NODES; i++ )
@@ -324,8 +329,13 @@ void ParticleUplinkCannonUpdate::setSpecialPowerOverridableDestination( const Co
324329 {
325330 m_overrideTargetDestination = *loc;
326331 m_manualTargetMode = true ;
332+ #if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_XFER_SAVE
327333 m_2ndLastDrivingClickFrame = m_lastDrivingClickFrame;
328334 m_lastDrivingClickFrame = TheGameLogic->getFrame ();
335+ #else
336+ m_2ndLastDrivingClickTimeMsec = m_lastDrivingClickTimeMsec;
337+ m_lastDrivingClickTimeMsec = timeGetTime ();
338+ #endif
329339 }
330340}
331341
@@ -517,7 +527,11 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update()
517527 else
518528 {
519529 Real speed = data->m_manualDrivingSpeed ;
520- const Bool useFasterSpeed = m_lastDrivingClickFrame - m_2ndLastDrivingClickFrame < data->m_doubleClickToFastDriveDelay ;
530+ #if RETAIL_COMPATIBLE_CRC
531+ const Bool useFasterSpeed = m_lastDrivingClickFrame != 0 && m_2ndLastDrivingClickFrame != 0 && m_lastDrivingClickFrame - m_2ndLastDrivingClickFrame < data->m_doubleClickToFastDriveDelay ;
532+ #else
533+ const Bool useFasterSpeed = m_lastDrivingClickTimeMsec != 0 && m_2ndLastDrivingClickTimeMsec != 0 && m_lastDrivingClickTimeMsec - m_2ndLastDrivingClickTimeMsec < data->m_doubleClickToFastDriveDelay ;
534+ #endif
521535 if ( useFasterSpeed )
522536 {
523537 // Because we double clicked, use the faster driving speed.
@@ -1309,17 +1323,22 @@ void ParticleUplinkCannonUpdate::crc( Xfer *xfer )
13091323// ------------------------------------------------------------------------------------------------
13101324/* * Xfer method
13111325 * Version Info:
1312- * 1: Initial version */
1326+ * 1: Initial version
1327+ * 2: Added m_startDecayFrame
1328+ * 3: Added m_manualTargetMode
1329+ * 4: Added m_orbitToTargetLaserRadius
1330+ * 5: Changed m_lastDrivingClickFrame and m_2ndLastDrivingClickFrame to m_lastDrivingClickTimeMsec and m_2ndLastDrivingClickTimeMsec (frames to milliseconds)
1331+ */
13131332// ------------------------------------------------------------------------------------------------
13141333void ParticleUplinkCannonUpdate::xfer ( Xfer *xfer )
13151334{
13161335 const ParticleUplinkCannonUpdateModuleData *data = getParticleUplinkCannonUpdateModuleData ();
13171336
13181337 // version
13191338#if RETAIL_COMPATIBLE_XFER_SAVE
1320- const XferVersion currentVersion = 2 ;
1339+ const XferVersion currentVersion = 3 ;
13211340#else
1322- const XferVersion currentVersion = 4 ;
1341+ const XferVersion currentVersion = 5 ;
13231342#endif
13241343 XferVersion version = currentVersion;
13251344 xfer->xferVersion ( &version, currentVersion );
@@ -1416,10 +1435,35 @@ void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
14161435 }
14171436
14181437 // the time of last manual target click
1438+ #if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_XFER_SAVE
1439+ // Retail builds stay at version 3 for compatibility, so always use old frame format
14191440 xfer->xferUnsignedInt ( &m_lastDrivingClickFrame );
1420-
1421- // the time of the 2nd last manual target click
14221441 xfer->xferUnsignedInt ( &m_2ndLastDrivingClickFrame );
1442+ #else
1443+ if ( version >= 5 )
1444+ {
1445+ xfer->xferUnsignedInt ( &m_lastDrivingClickTimeMsec );
1446+ xfer->xferUnsignedInt ( &m_2ndLastDrivingClickTimeMsec );
1447+ }
1448+ else
1449+ {
1450+ // Old versions stored frame numbers, which we can't meaningfully convert to milliseconds
1451+ UnsignedInt oldLastDrivingClickFrame = 0 ;
1452+ UnsignedInt old2ndLastDrivingClickFrame = 0 ;
1453+ xfer->xferUnsignedInt ( &oldLastDrivingClickFrame );
1454+ xfer->xferUnsignedInt ( &old2ndLastDrivingClickFrame );
1455+ if ( xfer->getXferMode () == XFER_LOAD )
1456+ {
1457+ m_lastDrivingClickTimeMsec = 0 ;
1458+ m_2ndLastDrivingClickTimeMsec = 0 ;
1459+ }
1460+ }
1461+ #endif
1462+
1463+ if ( version >= 3 )
1464+ {
1465+ xfer->xferBool ( &m_manualTargetMode );
1466+ }
14231467
14241468 if ( version >= 4 )
14251469 {
0 commit comments