In RemoteVoicePlayerState, the GetSpeakingChannels method clears the input list before writing to it.
In LocalVoicePlayerState, the GetSpeakingChannelsmethod does not clear the input list before writing to it.
In my project, I have a static list that's reused for all GetSpeakingChannels calls. Originally, it was used only for remote players, but it has recently been used for local players as well. Since the local player never cleared the list, this sometimes led to strange behaviour in other systems that I eventually tracked down to LocalVoicePlayerState not clearing the list before writing to it.
Ideally, LocalVoicePlayerState.GetSpeakingChannels should also clear the list. If that's not desired, either RemoteVoicePlayerState should also not clear the list, or a doc comment should be written stating that clearing behaviour is undefined.
In
RemoteVoicePlayerState, theGetSpeakingChannelsmethod clears the input list before writing to it.In
LocalVoicePlayerState, theGetSpeakingChannelsmethod does not clear the input list before writing to it.In my project, I have a static list that's reused for all
GetSpeakingChannelscalls. Originally, it was used only for remote players, but it has recently been used for local players as well. Since the local player never cleared the list, this sometimes led to strange behaviour in other systems that I eventually tracked down toLocalVoicePlayerStatenot clearing the list before writing to it.Ideally,
LocalVoicePlayerState.GetSpeakingChannelsshould also clear the list. If that's not desired, eitherRemoteVoicePlayerStateshould also not clear the list, or a doc comment should be written stating that clearing behaviour is undefined.