diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index 28e24b25..30563f23 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -276,4 +276,8 @@ void EXT_FUNC GameDLLInit() Bot_RegisterCVars(); Tutor_RegisterCVars(); Hostage_RegisterCVars(); + +#ifdef REGAMEDLL_FIXES + VoiceGameMgr_RegisterCVars(); +#endif } diff --git a/regamedll/game_shared/voice_gamemgr.cpp b/regamedll/game_shared/voice_gamemgr.cpp index f1428517..c36451ef 100644 --- a/regamedll/game_shared/voice_gamemgr.cpp +++ b/regamedll/game_shared/voice_gamemgr.cpp @@ -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) { 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_msgRequestState = REG_USER_MSG("ReqState", 0); - // 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); +#ifndef REGAMEDLL_FIXES + VoiceGameMgr_RegisterCVars(); +#endif return true; } diff --git a/regamedll/game_shared/voice_gamemgr.h b/regamedll/game_shared/voice_gamemgr.h index d1a6640d..80f35d47 100644 --- a/regamedll/game_shared/voice_gamemgr.h +++ b/regamedll/game_shared/voice_gamemgr.h @@ -84,4 +84,5 @@ private: extern cvar_t sv_alltalk; +void VoiceGameMgr_RegisterCVars(); void VoiceServerDebug(const char *pFmt, ...);