Преглед изворни кода

15 GiB allocate memory fix (0_0)

Tigran пре 4 година
родитељ
комит
168f3c508b
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      MafiaTelegramBot/Game/GameRooms/GameRoom.MessageHandler.cs

+ 1 - 1
MafiaTelegramBot/Game/GameRooms/GameRoom.MessageHandler.cs

@@ -58,7 +58,7 @@ namespace MafiaTelegramBot.Game.GameRooms
                 var knownRoles = player.CurrentRole.KnownRoles;
                 var message = strings.players_list;
                 var stopIndex = -1;
-                for (var i = 0; i <= players.Length && i != stopIndex; ++i)
+                for (var i = 0; i != stopIndex; i = (i+1) % players.Length)
                 {
                     i %= players.Length;
                     if (stopIndex == -1 && players[i].Id == nextPlayer.Id) stopIndex = i;