Option for clients to spectate the game without respawning

This commit is contained in:
Joonas Rikkonen
2017-09-25 21:30:55 +03:00
parent 5eb1544f1e
commit f127c410b0
6 changed files with 77 additions and 49 deletions
@@ -110,7 +110,10 @@ namespace Barotrauma.Networking
private List<Client> GetClientsToRespawn()
{
return networkMember.ConnectedClients.FindAll(c => c.inGame && (c.Character == null || c.Character.IsDead));
return networkMember.ConnectedClients.FindAll(c =>
c.inGame &&
(!c.SpectateOnly || !((GameServer)networkMember).AllowSpectating) &&
(c.Character == null || c.Character.IsDead));
}
public void Update(float deltaTime)