Fixed hosts character being taken into account in both teams' job assignment

This commit is contained in:
Regalis
2017-03-14 19:50:40 +02:00
parent 3f590da395
commit 4a37dab3ca
+4 -1
View File
@@ -1879,7 +1879,9 @@ namespace Barotrauma.Networking
int[] assignedClientCount = new int[JobPrefab.List.Count]; int[] assignedClientCount = new int[JobPrefab.List.Count];
if (characterInfo != null && assignHost) if (assignHost)
{
if (characterInfo != null)
{ {
assignedClientCount[JobPrefab.List.FindIndex(jp => jp == GameMain.NetLobbyScreen.JobPreferences[0])] = 1; assignedClientCount[JobPrefab.List.FindIndex(jp => jp == GameMain.NetLobbyScreen.JobPreferences[0])] = 1;
} }
@@ -1887,6 +1889,7 @@ namespace Barotrauma.Networking
{ {
assignedClientCount[JobPrefab.List.IndexOf(myCharacter.Info.Job.Prefab)] = 1; assignedClientCount[JobPrefab.List.IndexOf(myCharacter.Info.Job.Prefab)] = 1;
} }
}
//count the clients who already have characters with an assigned job //count the clients who already have characters with an assigned job
foreach (Client c in connectedClients) foreach (Client c in connectedClients)