From 50a526a02dabb7a1a8a4a1cbd07c91936c197670 Mon Sep 17 00:00:00 2001 From: miniduikboot Date: Sat, 8 Jan 2022 17:38:22 +0100 Subject: [PATCH] Clamp taskCount to the length of the task list New tasks cannot be created at this point because we don't know the underlying tasks. So we try to maintain the tasks we do know of. --- src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs b/src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs index 0b1abce..71bd53d 100644 --- a/src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs +++ b/src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs @@ -85,9 +85,9 @@ namespace Impostor.Server.Net.Inner.Objects var taskCount = reader.ReadByte(); - if (Tasks.Count != taskCount) + if (Tasks.Count < taskCount) { - Tasks = new List(taskCount); + taskCount = (byte)Tasks.Count; } for (var i = 0; i < taskCount; i++) -- 2.39.5