diff --git a/src/game/server/hl2mp/hl2mp_cvars.cpp b/src/game/server/hl2mp/hl2mp_cvars.cpp index 11986ee8c..aef59251f 100644 --- a/src/game/server/hl2mp/hl2mp_cvars.cpp +++ b/src/game/server/hl2mp/hl2mp_cvars.cpp @@ -22,4 +22,10 @@ ConVar mp_ready_signal( "mp_ready_signal", "ready", FCVAR_GAMEDLL, - "Text that each player must speak for the match to begin" ); \ No newline at end of file + "Text that each player must speak for the match to begin" ); + +ConVar sv_melee_viewkick( + "sv_melee_viewkick", + "0", + FCVAR_REPLICATED, + "Adds melee view kick" ); \ No newline at end of file diff --git a/src/game/server/hl2mp/hl2mp_cvars.h b/src/game/server/hl2mp/hl2mp_cvars.h index d0cb68f92..91b2e3cba 100644 --- a/src/game/server/hl2mp/hl2mp_cvars.h +++ b/src/game/server/hl2mp/hl2mp_cvars.h @@ -16,5 +16,6 @@ extern ConVar mp_restartround; extern ConVar mp_readyrestart; extern ConVar mp_ready_signal; +extern ConVar sv_melee_viewkick; #endif //HL2MP_CVARS_H diff --git a/src/game/shared/hl2mp/hl2mp_gamerules.cpp b/src/game/shared/hl2mp/hl2mp_gamerules.cpp index 87a3cf6e3..969b3fc79 100644 --- a/src/game/shared/hl2mp/hl2mp_gamerules.cpp +++ b/src/game/shared/hl2mp/hl2mp_gamerules.cpp @@ -51,7 +51,6 @@ extern CBaseEntity *g_pLastRebelSpawn; #endif - REGISTER_GAMERULES_CLASS( CHL2MPRules ); BEGIN_NETWORK_TABLE_NOBASE( CHL2MPRules, DT_HL2MPRules ) diff --git a/src/game/shared/hl2mp/weapon_hl2mpbasebasebludgeon.cpp b/src/game/shared/hl2mp/weapon_hl2mpbasebasebludgeon.cpp index b1b01f6d5..daf810806 100644 --- a/src/game/shared/hl2mp/weapon_hl2mpbasebasebludgeon.cpp +++ b/src/game/shared/hl2mp/weapon_hl2mpbasebasebludgeon.cpp @@ -21,6 +21,7 @@ #include "ndebugoverlay.h" #include "te_effect_dispatch.h" #include "ilagcompensationmanager.h" + #include "hl2mp_cvars.h" #endif // memdbgon must be the last include file in a .cpp file!!! @@ -135,7 +136,8 @@ void CBaseHL2MPBludgeonWeapon::Hit( trace_t &traceHit, Activity nHitActivity ) CBasePlayer *pPlayer = ToBasePlayer( GetOwner() ); //Do view kick - AddViewKick(); + if ( sv_melee_viewkick.GetBool() ) + AddViewKick(); CBaseEntity *pHitEntity = traceHit.m_pEnt; diff --git a/src/game/shared/hl2mp/weapon_stunstick.cpp b/src/game/shared/hl2mp/weapon_stunstick.cpp index aa15f9589..f11645cc8 100644 --- a/src/game/shared/hl2mp/weapon_stunstick.cpp +++ b/src/game/shared/hl2mp/weapon_stunstick.cpp @@ -77,7 +77,7 @@ public: float GetRange( void ) { return STUNSTICK_RANGE; } float GetFireRate( void ) { return STUNSTICK_REFIRE; } - void AddViewKick( void ); // should be client-side, much like the crowbar + void AddViewKick( void ); bool Deploy( void ); bool Holster( CBaseCombatWeapon *pSwitchingTo = NULL );