Moved reg cvar sv_alltalk, voice_serverdebug into GameDLLInit

This commit is contained in:
s1lent 2017-11-27 23:46:05 +07:00
parent 0318c364dd
commit 519a73179f
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
3 changed files with 18 additions and 6 deletions

View File

@ -276,4 +276,8 @@ void EXT_FUNC GameDLLInit()
Bot_RegisterCVars(); Bot_RegisterCVars();
Tutor_RegisterCVars(); Tutor_RegisterCVars();
Hostage_RegisterCVars(); Hostage_RegisterCVars();
#ifdef REGAMEDLL_FIXES
VoiceGameMgr_RegisterCVars();
#endif
} }

View File

@ -44,6 +44,16 @@ CVoiceGameMgr::~CVoiceGameMgr()
; ;
} }
void VoiceGameMgr_RegisterCVars()
{
// register voice_serverdebug if it hasn't been registered already
if (!CVAR_GET_POINTER("voice_serverdebug"))
CVAR_REGISTER(&voice_serverdebug);
if (!CVAR_GET_POINTER("sv_alltalk"))
CVAR_REGISTER(&sv_alltalk);
}
bool CVoiceGameMgr::Init(IVoiceGameMgrHelper *pHelper, int maxClients) bool CVoiceGameMgr::Init(IVoiceGameMgrHelper *pHelper, int maxClients)
{ {
m_pHelper = pHelper; m_pHelper = pHelper;
@ -54,12 +64,9 @@ bool CVoiceGameMgr::Init(IVoiceGameMgrHelper *pHelper, int maxClients)
m_msgPlayerVoiceMask = REG_USER_MSG("VoiceMask", VOICE_MAX_PLAYERS_DW * 4 * 2); m_msgPlayerVoiceMask = REG_USER_MSG("VoiceMask", VOICE_MAX_PLAYERS_DW * 4 * 2);
m_msgRequestState = REG_USER_MSG("ReqState", 0); m_msgRequestState = REG_USER_MSG("ReqState", 0);
// register voice_serverdebug if it hasn't been registered already #ifndef REGAMEDLL_FIXES
if (!CVAR_GET_POINTER("voice_serverdebug")) VoiceGameMgr_RegisterCVars();
CVAR_REGISTER(&voice_serverdebug); #endif
if (!CVAR_GET_POINTER("sv_alltalk"))
CVAR_REGISTER(&sv_alltalk);
return true; return true;
} }

View File

@ -84,4 +84,5 @@ private:
extern cvar_t sv_alltalk; extern cvar_t sv_alltalk;
void VoiceGameMgr_RegisterCVars();
void VoiceServerDebug(const char *pFmt, ...); void VoiceServerDebug(const char *pFmt, ...);