From dd92074f48f9aff74e151f1662ad2c790a16a726 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sun, 9 Jun 2019 23:05:16 +0300 Subject: [PATCH] (f63e4c47c) Spectators can hear the living players' voice chat (TODO: don't send voice data to spectators whose camera is too far from the speaker?) --- .../BarotraumaServer/Source/Networking/Voip/VoipServer.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Barotrauma/BarotraumaServer/Source/Networking/Voip/VoipServer.cs b/Barotrauma/BarotraumaServer/Source/Networking/Voip/VoipServer.cs index b282901ce..1c89cd988 100644 --- a/Barotrauma/BarotraumaServer/Source/Networking/Voip/VoipServer.cs +++ b/Barotrauma/BarotraumaServer/Source/Networking/Voip/VoipServer.cs @@ -77,9 +77,10 @@ namespace Barotrauma.Networking bool recipientSpectating = recipient.Character == null || recipient.Character.IsDead; bool senderSpectating = sender.Character == null || sender.Character.IsDead; - //spectators cannot speak with in-game players or vice versa - //TODO: allow spectators to hear the voice chat if close enough to the speaker? - if (recipientSpectating != senderSpectating) { return false; } + //TODO: only allow spectators to hear the voice chat if close enough to the speaker? + + //non-spectators cannot hear spectators + if (senderSpectating && !recipientSpectating) { return false; } //both spectating, no need to do radio/distance checks if (recipientSpectating && senderSpectating) { return true; }