Team ID assignment fixes:

- Clients are assigned to team 1 in sandbox mode (because the host is also in team 1).
- Respawning characters are always assigned to team 1 (otherwise mid-round joining clients would end up in team 0 because the team assignment is done when the round starts)
This commit is contained in:
Regalis
2017-06-03 18:08:47 +03:00
parent fe81355039
commit 2b27755b61
4 changed files with 16 additions and 8 deletions
@@ -90,7 +90,7 @@ namespace Barotrauma
return teamNames[teamID];
}
public override bool AssignTeamIDs(List<Client> clients, out int hostTeam)
public override bool AssignTeamIDs(List<Client> clients, out byte hostTeam)
{
List<Client> randList = new List<Client>(clients);
for (int i = 0; i < randList.Count; i++)
@@ -115,7 +115,7 @@ namespace Barotrauma
}
if (halfPlayers * 2 == randList.Count)
{
hostTeam = Rand.Range(1, 2);
hostTeam = (byte)Rand.Range(1, 2);
}
else if (halfPlayers * 2 < randList.Count)
{
+1 -1
View File
@@ -230,7 +230,7 @@ namespace Barotrauma
public virtual void Update(float deltaTime) { }
public virtual bool AssignTeamIDs(List<Networking.Client> clients, out int hostTeam)
public virtual bool AssignTeamIDs(List<Networking.Client> clients, out byte hostTeam)
{
clients.ForEach(c => c.TeamID = 1);
hostTeam = 1;