From 341058a084db08c60bd50dee0e313ebe87bcb2a8 Mon Sep 17 00:00:00 2001 From: VladimirKhil Date: Mon, 29 Apr 2024 22:13:41 +0200 Subject: [PATCH] Fix final question answers --- src/SICore/SICore/Clients/Game/Game.cs | 5 ++++- src/SICore/SICore/Clients/Game/GameLogic.cs | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/SICore/SICore/Clients/Game/Game.cs b/src/SICore/SICore/Clients/Game/Game.cs index 7a6259b2..183f819e 100644 --- a/src/SICore/SICore/Clients/Game/Game.cs +++ b/src/SICore/SICore/Clients/Game/Game.cs @@ -2066,9 +2066,12 @@ private void OnAnswer(Message message, string[] args) for (var i = 0; i < ClientData.Players.Count; i++) { - if (ClientData.Players[i].Name == message.Sender && ClientData.QuestionPlayState.AnswererIndicies.Contains(i) && ClientData.Players[i].Answer == "") + if (ClientData.Players[i].Name == message.Sender + && ClientData.QuestionPlayState.AnswererIndicies.Contains(i) + && ClientData.Players[i].Flag) { ClientData.AnswererIndex = i; + ClientData.Players[i].Flag = false; _gameActions.SendMessageWithArgs(Messages.PersonFinalAnswer, i); break; } diff --git a/src/SICore/SICore/Clients/Game/GameLogic.cs b/src/SICore/SICore/Clients/Game/GameLogic.cs index 6d6a562a..7b5e08ab 100644 --- a/src/SICore/SICore/Clients/Game/GameLogic.cs +++ b/src/SICore/SICore/Clients/Game/GameLogic.cs @@ -3220,6 +3220,7 @@ private void AskAnswer() if (_data.QuestionPlayState.AnswererIndicies.Contains(i)) { _data.Players[i].Answer = ""; + _data.Players[i].Flag = true; _gameActions.SendMessage(Messages.Answer, _data.Players[i].Name); } }