Skip to content

Commit

Permalink
Fix: Moved ConVar sv_voiceenable after reading the buffer MSG_Read*
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Feb 10, 2016
1 parent 41a2c97 commit c8311da
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions revoice/src/revoice_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ int TranscodeVoice(const char* srcBuf, int srcBufLen, IVoiceCodec* srcCodec, IVo
}

void SV_ParseVoiceData_emu(IGameClient* cl) {
if (pcv_sv_voiceenable->value == 0.0f) {
return;
}

char chReceived[4096];
unsigned int nDataLength = g_RehldsFuncs->MSG_ReadShort();

Expand All @@ -74,6 +70,10 @@ void SV_ParseVoiceData_emu(IGameClient* cl) {

g_RehldsFuncs->MSG_ReadBuf(nDataLength, chReceived);

if (pcv_sv_voiceenable->value == 0.0f) {
return;
}

CRevoicePlayer* srcPlayer = GetPlayerByClientPtr(cl);
srcPlayer->SetLastVoiceTime(g_RehldsSv->GetTime());
srcPlayer->IncreaseVoiceRate(nDataLength);
Expand Down

0 comments on commit c8311da

Please sign in to comment.