Server ends the round if all characters are either dead or unconscious when autorestart is on (instead of waiting for everyone to be dead)

This commit is contained in:
Joonas Rikkonen
2017-06-04 18:04:37 +03:00
parent 24424cfb51
commit 55cb56da59

View File

@@ -402,9 +402,9 @@ namespace Barotrauma.Networking
entityEventManager.Update(connectedClients);
bool isCrewDead =
connectedClients.Find(c => c.Character != null && !c.Character.IsDead)==null &&
(myCharacter == null || myCharacter.IsDead);
bool isCrewDead =
connectedClients.All(c => c.Character == null || c.Character.IsDead || c.Character.IsUnconscious) &&
(myCharacter == null || myCharacter.IsDead || myCharacter.IsUnconscious);
//restart if all characters are dead or submarine is at the end of the level
if ((autoRestart && isCrewDead)