Skip to content

Commit

Permalink
Moved reg cvar sv_alltalk, voice_serverdebug into GameDLLInit
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Nov 27, 2017
1 parent 0318c36 commit 519a731
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
4 changes: 4 additions & 0 deletions regamedll/dlls/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,8 @@ void EXT_FUNC GameDLLInit()
Bot_RegisterCVars();
Tutor_RegisterCVars();
Hostage_RegisterCVars();

#ifdef REGAMEDLL_FIXES
VoiceGameMgr_RegisterCVars();
#endif
}
19 changes: 13 additions & 6 deletions regamedll/game_shared/voice_gamemgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions regamedll/game_shared/voice_gamemgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,5 @@ class CVoiceGameMgr

extern cvar_t sv_alltalk;

void VoiceGameMgr_RegisterCVars();
void VoiceServerDebug(const char *pFmt, ...);

0 comments on commit 519a731

Please sign in to comment.