mirror of
https://github.com/rehlds/revoice.git
synced 2024-12-28 15:45:52 +03:00
Fix: Moved ConVar sv_voiceenable after reading the buffer MSG_Read*
This commit is contained in:
parent
41a2c97eba
commit
c8311da7da
@ -60,10 +60,6 @@ int TranscodeVoice(const char* srcBuf, int srcBufLen, IVoiceCodec* srcCodec, IVo
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SV_ParseVoiceData_emu(IGameClient* cl) {
|
void SV_ParseVoiceData_emu(IGameClient* cl) {
|
||||||
if (pcv_sv_voiceenable->value == 0.0f) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
char chReceived[4096];
|
char chReceived[4096];
|
||||||
unsigned int nDataLength = g_RehldsFuncs->MSG_ReadShort();
|
unsigned int nDataLength = g_RehldsFuncs->MSG_ReadShort();
|
||||||
|
|
||||||
@ -74,6 +70,10 @@ void SV_ParseVoiceData_emu(IGameClient* cl) {
|
|||||||
|
|
||||||
g_RehldsFuncs->MSG_ReadBuf(nDataLength, chReceived);
|
g_RehldsFuncs->MSG_ReadBuf(nDataLength, chReceived);
|
||||||
|
|
||||||
|
if (pcv_sv_voiceenable->value == 0.0f) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
CRevoicePlayer* srcPlayer = GetPlayerByClientPtr(cl);
|
CRevoicePlayer* srcPlayer = GetPlayerByClientPtr(cl);
|
||||||
srcPlayer->SetLastVoiceTime(g_RehldsSv->GetTime());
|
srcPlayer->SetLastVoiceTime(g_RehldsSv->GetTime());
|
||||||
srcPlayer->IncreaseVoiceRate(nDataLength);
|
srcPlayer->IncreaseVoiceRate(nDataLength);
|
||||||
|
Loading…
Reference in New Issue
Block a user