Skip to content

Commit 7b20c8a

Browse files
committed
fix(input): Replicate double-click fast drive timing fix to Generals
1 parent 19de815 commit 7b20c8a

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ class ParticleUplinkCannonUpdate : public UpdateModule, public SpecialPowerUpdat
225225
UnsignedInt m_nextDamagePulseFrame;
226226
UnsignedInt m_startAttackFrame;
227227
UnsignedInt m_startDecayFrame;
228-
UnsignedInt m_lastDrivingClickFrame;
229-
UnsignedInt m_2ndLastDrivingClickFrame;
228+
UnsignedInt m_lastDrivingClickTimeMsec;
229+
UnsignedInt m_2ndLastDrivingClickTimeMsec;
230230

231231
Bool m_upBonesCached;
232232
Bool m_defaultInfoCached;

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ ParticleUplinkCannonUpdate::ParticleUplinkCannonUpdate( Thing *thing, const Modu
183183
m_nextDamagePulseFrame = 0;
184184
m_startAttackFrame = 0;
185185
m_startDecayFrame = 0;
186-
m_lastDrivingClickFrame = 0;
187-
m_2ndLastDrivingClickFrame = 0;
186+
m_lastDrivingClickTimeMsec = 0;
187+
m_2ndLastDrivingClickTimeMsec = 0;
188188
m_clientShroudedLastFrame = FALSE;
189189

190190
for( Int i = 0; i < MAX_OUTER_NODES; i++ )
@@ -324,8 +324,8 @@ void ParticleUplinkCannonUpdate::setSpecialPowerOverridableDestination( const Co
324324
{
325325
m_overrideTargetDestination = *loc;
326326
m_manualTargetMode = true;
327-
m_2ndLastDrivingClickFrame = m_lastDrivingClickFrame;
328-
m_lastDrivingClickFrame = TheGameLogic->getFrame();
327+
m_2ndLastDrivingClickTimeMsec = m_lastDrivingClickTimeMsec;
328+
m_lastDrivingClickTimeMsec = timeGetTime();
329329
}
330330
}
331331

@@ -517,7 +517,7 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update()
517517
else
518518
{
519519
Real speed = data->m_manualDrivingSpeed;
520-
if( m_lastDrivingClickFrame - m_2ndLastDrivingClickFrame < data->m_doubleClickToFastDriveDelay )
520+
if( m_lastDrivingClickTimeMsec != 0 && m_2ndLastDrivingClickTimeMsec != 0 && m_lastDrivingClickTimeMsec - m_2ndLastDrivingClickTimeMsec < data->m_doubleClickToFastDriveDelay )
521521
{
522522
//Because we double clicked, use the faster driving speed.
523523
speed = data->m_manualFastDrivingSpeed;
@@ -1414,11 +1414,11 @@ void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
14141414
m_startDecayFrame = m_startAttackFrame + data->m_totalFiringFrames;
14151415
}
14161416

1417-
// the time of last manual target click
1418-
xfer->xferUnsignedInt( & m_lastDrivingClickFrame );
1417+
// the time of last manual target click (milliseconds)
1418+
xfer->xferUnsignedInt( & m_lastDrivingClickTimeMsec );
14191419

1420-
// the time of the 2nd last manual target click
1421-
xfer->xferUnsignedInt( &m_2ndLastDrivingClickFrame );
1420+
// the time of the 2nd last manual target click (milliseconds)
1421+
xfer->xferUnsignedInt( &m_2ndLastDrivingClickTimeMsec );
14221422

14231423
if( version >= 4 )
14241424
{

0 commit comments

Comments
 (0)