diff options
| author | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
|---|---|---|
| committer | John Schoenick <[email protected]> | 2015-09-09 18:35:41 -0700 |
| commit | 0d8dceea4310fde5706b3ce1c70609d72a38efdf (patch) | |
| tree | c831ef32c2c801a5c5a80401736b52c7b5a528ec /mp/src/game/client/c_baseviewmodel.cpp | |
| parent | Updated the SDK with the latest code from the TF and HL2 branches. (diff) | |
| download | source-sdk-2013-master.tar.xz source-sdk-2013-master.zip | |
Diffstat (limited to 'mp/src/game/client/c_baseviewmodel.cpp')
| -rw-r--r-- | mp/src/game/client/c_baseviewmodel.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/mp/src/game/client/c_baseviewmodel.cpp b/mp/src/game/client/c_baseviewmodel.cpp index 8ae21f63..28c804fb 100644 --- a/mp/src/game/client/c_baseviewmodel.cpp +++ b/mp/src/game/client/c_baseviewmodel.cpp @@ -18,6 +18,9 @@ #include "tools/bonelist.h" #include <KeyValues.h> #include "hltvcamera.h" +#ifdef TF_CLIENT_DLL + #include "tf_weaponbase.h" +#endif #if defined( REPLAY_ENABLED ) #include "replay/replaycamera.h" @@ -53,8 +56,8 @@ void FormatViewModelAttachment( Vector &vOrigin, bool bInverse ) // aspect ratio cancels out, so only need one factor // the difference between the screen coordinates of the 2 systems is the ratio // of the coefficients of the projection matrices (tan (fov/2) is that coefficient) - float factorX = worldx / viewx; - + // NOTE: viewx was coming in as 0 when folks set their viewmodel_fov to 0 and show their weapon. + float factorX = viewx ? ( worldx / viewx ) : 0.0f; float factorY = factorX; // Get the coordinates in the viewer's space. @@ -331,6 +334,16 @@ int C_BaseViewModel::DrawModel( int flags ) } } +#ifdef TF_CLIENT_DLL + CTFWeaponBase* pTFWeapon = dynamic_cast<CTFWeaponBase*>( pWeapon ); + if ( ( flags & STUDIO_RENDER ) && pTFWeapon && pTFWeapon->m_viewmodelStatTrakAddon ) + { + pTFWeapon->m_viewmodelStatTrakAddon->RemoveEffects( EF_NODRAW ); + pTFWeapon->m_viewmodelStatTrakAddon->DrawModel( flags ); + pTFWeapon->m_viewmodelStatTrakAddon->AddEffects( EF_NODRAW ); + } +#endif + return ret; } |