Merge pull request #428 from diamante0018/develop
[Voice] Clear muted list when dc
This commit is contained in:
commit
7dd3a6b290
@ -242,6 +242,11 @@ namespace Components
|
||||
}
|
||||
}
|
||||
|
||||
void Voice::CL_ClearMutedList()
|
||||
{
|
||||
std::memset(s_playerMute, 0, sizeof(s_playerMute));
|
||||
}
|
||||
|
||||
bool Voice::CL_IsPlayerMuted_Hk([[maybe_unused]] Game::SessionData* session, [[maybe_unused]] const int localClientNum, const int muteClientIndex)
|
||||
{
|
||||
AssertIn(muteClientIndex, Game::MAX_CLIENTS);
|
||||
@ -313,10 +318,7 @@ namespace Components
|
||||
|
||||
void Voice::UI_Mute_player(int clientNum, const int localClientNum)
|
||||
{
|
||||
if (Game::cgArray->clientNum != Game::sharedUiInfo->playerClientNums[clientNum])
|
||||
{
|
||||
CL_TogglePlayerMute(localClientNum, Game::sharedUiInfo->playerClientNums[clientNum]);
|
||||
}
|
||||
CL_TogglePlayerMute(localClientNum, Game::sharedUiInfo->playerClientNums[clientNum]);
|
||||
}
|
||||
|
||||
__declspec(naked) void Voice::UI_Mute_Player_Stub()
|
||||
@ -342,6 +344,8 @@ namespace Components
|
||||
std::memset(voicePacketCount, 0, sizeof(voicePacketCount));
|
||||
std::memset(s_playerMute, 0, sizeof(s_playerMute));
|
||||
|
||||
Events::OnSteamDisconnect(CL_ClearMutedList);
|
||||
|
||||
// Write voice packets to the server instead of other clients
|
||||
Utils::Hook(0x487935, CL_WriteVoicePacket_Hk, HOOK_CALL).install()->quick();
|
||||
Utils::Hook(0x5AD945, CL_WriteVoicePacket_Hk, HOOK_CALL).install()->quick();
|
||||
|
@ -31,6 +31,7 @@ namespace Components
|
||||
static void SV_PreGameUserVoice(Game::client_t* cl, Game::msg_t* msg);
|
||||
static void SV_VoicePacket(Game::netadr_t from, Game::msg_t* msg);
|
||||
|
||||
static void CL_ClearMutedList();
|
||||
static bool CL_IsPlayerMuted_Hk(Game::SessionData* session, int localClientNum, int muteClientIndex);
|
||||
static void CL_MutePlayer_Hk(Game::SessionData* session, int muteClientIndex);
|
||||
static void Voice_UnmuteMember_Hk(Game::SessionData* session, int clientNum);
|
||||
|
Loading…
Reference in New Issue
Block a user