From f3460f05bce3c3ed870880a133f7e0be0a5584a8 Mon Sep 17 00:00:00 2001 From: miniduikboot Date: Sun, 30 May 2021 18:23:12 +0200 Subject: [PATCH] Initialize Color to -1 instead of Red This could lead to an AC disconnect if the host picked red and waited for other players to rejoin before joining back himself. Before this commit, the host would SetColor himself to Red, but this would be flagged as all other players would have been set to Red as enums initialize to 0 (= Red) by default. After the host SetColor'd himself, the host will send over the color array, which initializes player colors to -1. This commit follows AU by also initializing the color to -1, preventing the AC from flagging the duplicate colors. --- src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs b/src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs index 1a4ac1c..e51906c 100644 --- a/src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs +++ b/src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs @@ -21,7 +21,7 @@ namespace Impostor.Server.Net.Inner.Objects public string PlayerName { get; internal set; } = string.Empty; - public ColorType Color { get; internal set; } + public ColorType Color { get; internal set; } = (ColorType)(-1); public HatType Hat { get; internal set; } -- 2.39.5