From e1fb9e4321dcd631cbcb30417e39a9be0db55578 Mon Sep 17 00:00:00 2001 From: Night Owl Date: Mon, 23 Apr 2018 22:50:59 +0500 Subject: [PATCH] Add mp_allow_hook cvar to turn on/off hook on spawn. --- dlls/3wave/threewave_gamerules.cpp | 8 ++++++-- dlls/game.cpp | 2 ++ dlls/game.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/3wave/threewave_gamerules.cpp b/dlls/3wave/threewave_gamerules.cpp index 4e553836..18cec449 100644 --- a/dlls/3wave/threewave_gamerules.cpp +++ b/dlls/3wave/threewave_gamerules.cpp @@ -426,7 +426,11 @@ void CThreeWave::PlayerSpawn( CBasePlayer *pPlayer ) // Start with shotgun and axe pPlayer->GiveNamedItem( "weapon_quakegun" ); - pPlayer->m_iQuakeItems |= ( IT_SHOTGUN | IT_AXE | IT_EXTRA_WEAPON ); + pPlayer->m_iQuakeItems |= ( IT_SHOTGUN | IT_AXE ); + + if( allowhook.value ) + pPlayer->m_iQuakeItems |= IT_EXTRA_WEAPON; + pPlayer->m_iQuakeWeapon = pPlayer->W_BestWeapon(); pPlayer->W_SetCurrentAmmo(); @@ -835,7 +839,7 @@ void CThreeWave::PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, entvars if( pTeamMate ) { - if ( pTeamMate->m_bHasFlag ) + if( pTeamMate->m_bHasFlag ) { pTeamMate->pFlagCarrierKiller = pk; pTeamMate->m_flFlagCarrierKillTime = gpGlobals->time + TEAM_CAPTURE_FRAG_CARRIER_ASSIST_TIMEOUT; diff --git a/dlls/game.cpp b/dlls/game.cpp index 633b39da..1790c818 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -45,6 +45,7 @@ cvar_t teamoverride = { "mp_teamoverride","1" }; cvar_t defaultteam = { "mp_defaultteam","0" }; cvar_t allowmonsters = { "mp_allowmonsters","0", FCVAR_SERVER }; cvar_t bhopcap = { "mp_bhopcap", "1", FCVAR_SERVER }; +cvar_t allowhook = { "mp_allow_hook", "1", FCVAR_SERVER }; cvar_t allow_spectators = { "allow_spectators", "0", FCVAR_SERVER }; // 0 prevents players from being spectators @@ -485,6 +486,7 @@ void GameDLLInit( void ) CVAR_REGISTER( &defaultteam ); CVAR_REGISTER( &allowmonsters ); CVAR_REGISTER( &bhopcap ); + CVAR_REGISTER( &allowhook ); CVAR_REGISTER( &mp_chattime ); diff --git a/dlls/game.h b/dlls/game.h index d7eea752..09c0fdaa 100644 --- a/dlls/game.h +++ b/dlls/game.h @@ -35,6 +35,7 @@ extern cvar_t teamlist; extern cvar_t teamoverride; extern cvar_t defaultteam; extern cvar_t allowmonsters; +extern cvar_t allowhook; // Engine Cvars extern cvar_t *g_psv_gravity;