Skip to content

Commit

Permalink
fix(client): fix possible race condition of setting target channel to…
Browse files Browse the repository at this point in the history
…o soon
  • Loading branch information
AvarianKnight committed Oct 27, 2021
1 parent 9c88517 commit 5aac892
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/init/proximity.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function addNearbyPlayers()
local ped = GetPlayerPed(ply)
local isTarget = currentVoiceTargets[serverId]
if #(coords - GetEntityCoords(ped)) < distance then
if not isTarget then
if not isTarget and MumbleGetVoiceChannelFromServerId(serverId) == serverId then
logger.info('Added %s as a voice target', serverId)
MumbleAddVoiceTargetChannel(voiceTarget, serverId)
currentVoiceTargets[serverId] = true
Expand Down

0 comments on commit 5aac892

Please sign in to comment.