mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-07 18:43:29 +00:00
Merge 4ff01ed2df
into 0d8dceea43
This commit is contained in:
commit
8d622036a9
1 changed files with 10 additions and 16 deletions
|
@ -3011,10 +3011,8 @@ void CTriggerCamera::Enable( void )
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
m_nPlayerButtons = pPlayer->m_nButtons;
|
||||
|
||||
|
||||
// Make the player invulnerable while under control of the camera. This will prevent situations where the player dies while under camera control but cannot restart their game due to disabled player inputs.
|
||||
m_nOldTakeDamage = m_hPlayer->m_takedamage;
|
||||
m_hPlayer->m_takedamage = DAMAGE_NO;
|
||||
|
@ -3084,8 +3082,13 @@ void CTriggerCamera::Enable( void )
|
|||
if ( m_pPath->m_flSpeed != 0 )
|
||||
m_targetSpeed = m_pPath->m_flSpeed;
|
||||
|
||||
m_flStopTime += m_pPath->GetDelay();
|
||||
// Compute the distance to the next path already:
|
||||
m_vecMoveDir = m_pPath->GetLocalOrigin() - GetLocalOrigin();
|
||||
m_moveDistance = VectorNormalize( m_vecMoveDir );
|
||||
m_flStopTime = gpGlobals->curtime + m_pPath->GetDelay();
|
||||
}
|
||||
else
|
||||
m_moveDistance = 0.0f;
|
||||
|
||||
|
||||
// copy over player information. If we're interpolating from
|
||||
|
@ -3125,16 +3128,13 @@ void CTriggerCamera::Enable( void )
|
|||
}
|
||||
|
||||
// Only track if we have a target
|
||||
if ( m_hTarget )
|
||||
if ( m_hTarget || (m_moveDistance > 0 && m_pPath) || HasSpawnFlags( SF_CAMERA_PLAYER_INTERRUPT ) )
|
||||
{
|
||||
// follow the player down
|
||||
SetThink( &CTriggerCamera::FollowTarget );
|
||||
SetNextThink( gpGlobals->curtime );
|
||||
}
|
||||
|
||||
m_moveDistance = 0;
|
||||
Move();
|
||||
|
||||
DispatchUpdateTransmitState();
|
||||
}
|
||||
|
||||
|
@ -3200,13 +3200,7 @@ void CTriggerCamera::FollowTarget( )
|
|||
if (m_hPlayer == NULL)
|
||||
return;
|
||||
|
||||
if ( m_hTarget == NULL )
|
||||
{
|
||||
Disable();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !HasSpawnFlags(SF_CAMERA_PLAYER_INFINITE_WAIT) && (!m_hTarget || m_flReturnTime < gpGlobals->curtime) )
|
||||
if ((!HasSpawnFlags(SF_CAMERA_PLAYER_INFINITE_WAIT) && (m_flReturnTime < gpGlobals->curtime)) || (!m_hTarget && !m_pPath))
|
||||
{
|
||||
Disable();
|
||||
return;
|
||||
|
@ -3278,9 +3272,9 @@ void CTriggerCamera::FollowTarget( )
|
|||
}
|
||||
}
|
||||
|
||||
SetNextThink( gpGlobals->curtime );
|
||||
|
||||
Move();
|
||||
|
||||
SetNextThink( gpGlobals->curtime );
|
||||
}
|
||||
|
||||
void CTriggerCamera::Move()
|
||||
|
|
Loading…
Reference in a new issue