Skip to content

Commit 19de815

Browse files
committed
fix(input): Convert double-click fast drive timing from frames to real-time milliseconds
1 parent c23ebe3 commit 19de815

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

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

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

191191
for( Int i = 0; i < MAX_OUTER_NODES; i++ )
@@ -374,8 +374,8 @@ void ParticleUplinkCannonUpdate::setSpecialPowerOverridableDestination( const Co
374374
{
375375
m_overrideTargetDestination = *loc;
376376
m_manualTargetMode = TRUE;
377-
m_2ndLastDrivingClickFrame = m_lastDrivingClickFrame;
378-
m_lastDrivingClickFrame = TheGameLogic->getFrame();
377+
m_2ndLastDrivingClickTimeMsec = m_lastDrivingClickTimeMsec;
378+
m_lastDrivingClickTimeMsec = timeGetTime();
379379
}
380380
}
381381

@@ -567,7 +567,7 @@ UpdateSleepTime ParticleUplinkCannonUpdate::update()
567567
else
568568
{
569569
Real speed = data->m_manualDrivingSpeed;
570-
if( m_scriptedWaypointMode || m_lastDrivingClickFrame - m_2ndLastDrivingClickFrame < data->m_doubleClickToFastDriveDelay )
570+
if( m_scriptedWaypointMode || (m_lastDrivingClickTimeMsec != 0 && m_2ndLastDrivingClickTimeMsec != 0 && m_lastDrivingClickTimeMsec - m_2ndLastDrivingClickTimeMsec < data->m_doubleClickToFastDriveDelay) )
571571
{
572572
//Because we double clicked, use the faster driving speed.
573573
speed = data->m_manualFastDrivingSpeed;
@@ -1498,11 +1498,11 @@ void ParticleUplinkCannonUpdate::xfer( Xfer *xfer )
14981498
m_startDecayFrame = m_startAttackFrame + data->m_totalFiringFrames;
14991499
}
15001500

1501-
// the time of last manual target click
1502-
xfer->xferUnsignedInt( & m_lastDrivingClickFrame );
1501+
// the time of last manual target click (milliseconds)
1502+
xfer->xferUnsignedInt( & m_lastDrivingClickTimeMsec );
15031503

1504-
// the time of the 2nd last manual target click
1505-
xfer->xferUnsignedInt( &m_2ndLastDrivingClickFrame );
1504+
// the time of the 2nd last manual target click (milliseconds)
1505+
xfer->xferUnsignedInt( &m_2ndLastDrivingClickTimeMsec );
15061506

15071507
if( version >= 3 )
15081508
{

0 commit comments

Comments
 (0)