]> git.deb.at Git - rhonda/impostor.git/commit
Initialize Color to -1 instead of Red
authorminiduikboot <mini@duikbo.at>
Sun, 30 May 2021 16:23:12 +0000 (18:23 +0200)
committerminiduikboot <mini@duikbo.at>
Sun, 30 May 2021 16:30:47 +0000 (18:30 +0200)
commitf3460f05bce3c3ed870880a133f7e0be0a5584a8
tree1685bf896c2224cc013856b5ec42292d72cbc184
parenta13fee108f36d828e46bfd2315457b85b87ec35e
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