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
+9 -6
View File
@@ -1879,13 +1879,16 @@ namespace Barotrauma.Networking
int[] assignedClientCount = new int[JobPrefab.List.Count]; int[] assignedClientCount = new int[JobPrefab.List.Count];
if (characterInfo != null && assignHost) if (assignHost)
{ {
assignedClientCount[JobPrefab.List.FindIndex(jp => jp == GameMain.NetLobbyScreen.JobPreferences[0])] = 1; if (characterInfo != null)
} {
else if (myCharacter != null && !myCharacter.IsDead) assignedClientCount[JobPrefab.List.FindIndex(jp => jp == GameMain.NetLobbyScreen.JobPreferences[0])] = 1;
{ }
assignedClientCount[JobPrefab.List.IndexOf(myCharacter.Info.Job.Prefab)] = 1; else if (myCharacter != null && !myCharacter.IsDead)
{
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