Added sv_deadtalk

This commit is contained in:
Kamay Xutax 2024-09-14 06:44:49 +02:00
parent 775985235a
commit 72aea29a34

View file

@ -6,6 +6,7 @@
//============================================================================= //=============================================================================
#include "cbase.h" #include "cbase.h"
#include "convar.h"
#include "mp_shareddefs.h" #include "mp_shareddefs.h"
#include "basemultiplayerplayer.h" #include "basemultiplayerplayer.h"
@ -103,6 +104,8 @@ bool CBaseMultiplayerPlayer::SpeakConceptIfAllowed( int iConcept, const char *mo
return SpeakIfAllowed( g_pszMPConcepts[iConcept], modifiers, pszOutResponseChosen, bufsize, filter ); return SpeakIfAllowed( g_pszMPConcepts[iConcept], modifiers, pszOutResponseChosen, bufsize, filter );
} }
ConVar sv_deadtalk("sv_deadtalk", "1");
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Purpose: // Purpose:
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -121,7 +124,7 @@ bool CBaseMultiplayerPlayer::CanHearAndReadChatFrom( CBasePlayer *pPlayer )
return false; return false;
// can't hear dead players if we're alive // can't hear dead players if we're alive
if ( pPlayer->m_lifeState != LIFE_ALIVE && m_lifeState == LIFE_ALIVE ) if ( ( pPlayer->m_lifeState != LIFE_ALIVE && m_lifeState == LIFE_ALIVE ) && !sv_deadtalk.GetBool() )
return false; return false;
return true; return true;