Merge pull request #6577 from pchote/fix-validation
Don’t die when connecting to a full server.
This commit is contained in:
@@ -203,10 +203,9 @@ namespace OpenRA.Mods.Common.Server
|
|||||||
public void ClientJoined(S server, Connection conn)
|
public void ClientJoined(S server, Connection conn)
|
||||||
{
|
{
|
||||||
var client = server.GetClient(conn);
|
var client = server.GetClient(conn);
|
||||||
var slot = server.LobbyInfo.Clients[client.Index].Slot;
|
|
||||||
|
|
||||||
// Validate whether color is allowed and get an alternative if it isn't
|
// Validate whether color is allowed and get an alternative if it isn't
|
||||||
if (!server.LobbyInfo.Slots[slot].LockColor)
|
if (client.Slot == null ||!server.LobbyInfo.Slots[client.Slot].LockColor)
|
||||||
client.Color = ColorValidator.ValidatePlayerColorAndGetAlternative(server, client.Color, client.Index);
|
client.Color = ColorValidator.ValidatePlayerColorAndGetAlternative(server, client.Color, client.Index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user