From 5130cdd357c5b3b442d39ee05052739419456e77 Mon Sep 17 00:00:00 2001 From: enneract Date: Sun, 14 Dec 2014 14:47:51 +0100 Subject: Limit view quake's mangitude. --- src/cgame/cg_local.h | 1 + src/cgame/cg_main.c | 4 +++- src/cgame/cg_view.c | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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; } /* -- cgit