summaryrefslogtreecommitdiff
path: root/src/cgame/cg_view.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame/cg_view.c')
-rw-r--r--src/cgame/cg_view.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c
index 4b2b254..97b7582 100644
--- a/src/cgame/cg_view.c
+++ b/src/cgame/cg_view.c
@@ -578,6 +578,18 @@ void CG_OffsetFirstPersonView( void )
origin[ 2 ] += cg.predictedPlayerState.viewheight;
return;
}
+ // camera shake effect
+ else if( cg.snap->ps.stats[ STAT_SHAKE ] > 0 )
+ {
+ float fac, mag;
+
+ fac = (float) cg.snap->ps.stats[ STAT_SHAKE ] *
+ cg_cameraShakeMagnitude.value * 0.15f;
+
+ angles[ 0 ] += crandom() * fac;
+ angles[ 1 ] += crandom() * fac;
+ angles[ 2 ] += crandom() * fac;
+ }
// add angles based on damage kick
if( cg.damageTime )