From ea0e0d09489734e78bc4348a2f3f3df3fa7948cf Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 11 Feb 2021 22:55:34 +0300 Subject: [PATCH] Fix bug with vote --- MafiaGame/MainWindow.xaml.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/MafiaGame/MainWindow.xaml.cs b/MafiaGame/MainWindow.xaml.cs index 2696efd..832a529 100644 --- a/MafiaGame/MainWindow.xaml.cs +++ b/MafiaGame/MainWindow.xaml.cs @@ -275,6 +275,13 @@ namespace MafiaGame public void ShowDay(bool voting, Role role, List players) { GameDaySelect.IsEnabled = voting; + GameDaySelect.Items.Clear(); + foreach (Player player in players) + { + ListBoxItem item = new ListBoxItem(); + item.Content = player.Id.ToString() + ") " + player.Name; + GameDaySelect.Items.Add(item); + } if (role == Role.Died) { GameDayHotBar.Text = "Коли умер, жди"; @@ -284,12 +291,6 @@ namespace MafiaGame if (voting) { GameDayHotBar.Text = "Голосуй и молись"; - foreach (Player player in players) - { - ListBoxItem item = new ListBoxItem(); - item.Content = player.Id.ToString() + ") " + player.Name; - MainWindow.Instance.GameDaySelect.Items.Add(item); - } } else {