2
0
mirror of https://github.com/rehlds/revoice.git synced 2024-12-27 23:25:53 +03:00

Fix: Moved ConVar sv_voiceenable after reading the buffer MSG_Read*

This commit is contained in:
s1lentq 2016-02-11 05:03:24 +06:00
parent 41a2c97eba
commit c8311da7da

View File

@ -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();
@ -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);