mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-08 11:01:33 +00:00
Fix anglesensor
► This fix is intended to handle player entities more accurately by using their eye direction (view direction) instead of their general forward vector. This would correct cases where something relies on the player's view angle, such as sensors, targeting, or alignment systems, ensuring that the player’s actual looking direction is used.
This commit is contained in:
parent
a62efecf62
commit
ea02b64cf6
1 changed files with 8 additions and 1 deletions
|
@ -216,7 +216,14 @@ void CPointAngleSensor::Think(void)
|
|||
if (m_hTargetEntity != NULL)
|
||||
{
|
||||
Vector forward;
|
||||
m_hTargetEntity->GetVectors(&forward, NULL, NULL);
|
||||
if ( dynamic_cast< CBasePlayer * >( m_hTargetEntity.Get() ) != NULL )
|
||||
{
|
||||
dynamic_cast< CBasePlayer * >( m_hTargetEntity.Get() )->EyeVectors( &forward, NULL, NULL );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_hTargetEntity->GetVectors( &forward, NULL, NULL );
|
||||
}
|
||||
m_TargetDir.Set(forward, this, this);
|
||||
|
||||
if (m_hLookAtEntity != NULL)
|
||||
|
|
Loading…
Reference in a new issue