(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?)

This commit is contained in:
Joonas Rikkonen
2019-06-09 23:05:16 +03:00
parent 3595d24ff2
commit dd92074f48
@@ -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; }