Selaa lähdekoodia

Merge remote-tracking branch 'origin/develop' into develop

# Conflicts:
#	MafiaTelegramBot/Game/GameRoles/BodyguardRole.cs
Tigran 4 vuotta sitten
vanhempi
commit
400c7c0529
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3 3
      MafiaTelegramBot/Game/GameRoles/BodyguardRole.cs

+ 3 - 3
MafiaTelegramBot/Game/GameRoles/BodyguardRole.cs

@@ -19,10 +19,10 @@ namespace MafiaTelegramBot.Game.GameRoles
 
         public override async Task NightAction()
         {
-            NightTargetId = -1;
             if (Player.IsAlive)
             {
-                NightTargetList = Room.Players.Values.Where(p => p.IsAlive && p.Id != Player.Id).ToList();
+                NightTargetList = Room.Players.Values.Where(p => p.IsAlive && p.Id != Player.Id && p.Id != NightTargetId).ToList();
+                NightTargetId = -1;
                 var message = await Bot.SendWithMarkdown2(Player.ChatId, strings.choose_target_to_protect,
                     Keyboard.NightChooseTargetKeyboard(NightTargetList, Player.Id));
                 MessageId = message.MessageId;
@@ -32,7 +32,7 @@ namespace MafiaTelegramBot.Game.GameRoles
 
         public override async Task ApplyNightActionResult()
         {
-            if (NightTargetId != -2 && NightTargetId != -3)
+            if (NightTargetId != -2)
             {
                 if (NightTargetId == -1) await SetRandomNightTarget();
                 if(Room.Players.ContainsKey(NightTargetId))