summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
authorenneract <trem.redman@gmail.com>2014-12-14 14:47:51 +0100
committerenneract <trem.redman@gmail.com>2014-12-14 14:47:51 +0100
commit5130cdd357c5b3b442d39ee05052739419456e77 (patch)
treee4b8ed3e15a06ca91c633346d51fa4203cf1b156 /src/cgame
parentbb6121f265d70282aeba57a252996f130e5d6df8 (diff)
Limit view quake's mangitude.
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_local.h1
-rw-r--r--src/cgame/cg_main.c4
-rw-r--r--src/cgame/cg_view.c3
3 files changed, 7 insertions, 1 deletions
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 97a21d9..7d4bd3d 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1592,6 +1592,7 @@ extern vmCvar_t cg_BubbleZoom;
extern vmCvar_t cg_viewQuake;
extern vmCvar_t cg_viewQuakeLambda;
+extern vmCvar_t cg_viewQuakeLimit;
//
// cg_main.c
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index c5ad444..366a6a3 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -230,6 +230,7 @@ vmCvar_t cg_EDGEFPSFIX;
vmCvar_t cg_viewQuake;
vmCvar_t cg_viewQuakeLambda;
+vmCvar_t cg_viewQuakeLimit;
typedef struct
{
@@ -377,7 +378,8 @@ static cvarTable_t cvarTable[ ] =
{ &cg_EDGEFPSFIX, "cg_EDGEFPSFIX", "0", CVAR_ARCHIVE|CVAR_USERINFO },
{ &cg_viewQuake, "cg_viewQuake", "1", CVAR_ARCHIVE },
- { &cg_viewQuakeLambda, "cg_viewQuakeLambda", "-10", CVAR_ARCHIVE }
+ { &cg_viewQuakeLambda, "cg_viewQuakeLambda", "-10", CVAR_ARCHIVE },
+ { &cg_viewQuakeLimit, "cg_viewQuakeLimit", "5", CVAR_ARCHIVE }
};
static int cvarTableSize = sizeof( cvarTable ) / sizeof( cvarTable[0] );
diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c
index 68f9287..eb6e88d 100644
--- a/src/cgame/cg_view.c
+++ b/src/cgame/cg_view.c
@@ -556,6 +556,9 @@ void CG_InduceViewQuake( vec3_t src, float mag )
dist = Distance( src, cg.refdef.vieworg );
cg.viewQuake += mag / dist / dist * 1000.0f;
}
+
+ if( cg.viewQuake > cg_viewQuakeLimit.value )
+ cg.viewQuake = cg_viewQuakeLimit.value;
}
/*