Fixed point_viewcontrol "Don't set player view" keyvalue not working properly

This commit is contained in:
Blixibon 2021-09-20 22:10:34 -05:00
parent 4d4296dac2
commit f278491d86

View File

@ -3497,12 +3497,14 @@ void CTriggerCamera::Enable( void )
#ifdef MAPBASE #ifdef MAPBASE
if (!m_bDontSetPlayerView) if (!m_bDontSetPlayerView)
#endif #endif
pPlayer->SetViewEntity( this );
// Hide the player's viewmodel
if ( pPlayer->GetActiveWeapon() )
{ {
pPlayer->GetActiveWeapon()->AddEffects( EF_NODRAW ); pPlayer->SetViewEntity( this );
// Hide the player's viewmodel
if ( pPlayer->GetActiveWeapon() )
{
pPlayer->GetActiveWeapon()->AddEffects( EF_NODRAW );
}
} }
// Only track if we have a target // Only track if we have a target
@ -3548,11 +3550,16 @@ void CTriggerCamera::Disable( void )
pBasePlayer->RemoveSolidFlags( FSOLID_NOT_SOLID ); pBasePlayer->RemoveSolidFlags( FSOLID_NOT_SOLID );
} }
if (!m_bDontSetPlayerView) if ( HasSpawnFlags( SF_CAMERA_PLAYER_TAKECONTROL ) )
pBasePlayer->SetViewEntity( NULL ); {
pBasePlayer->EnableControl( TRUE );
}
pBasePlayer->EnableControl(TRUE); if (!m_bDontSetPlayerView)
pBasePlayer->m_Local.m_bDrawViewmodel = true; {
pBasePlayer->SetViewEntity( NULL );
pBasePlayer->m_Local.m_bDrawViewmodel = true;
}
} }
if ( HasSpawnFlags( SF_CAMERA_PLAYER_SETFOV ) ) if ( HasSpawnFlags( SF_CAMERA_PLAYER_SETFOV ) )