Skip to content

Commit 6ac109f

Browse files
authored
To infinity and beyond
"Infinite" loop now works instead of never-loop!
1 parent e608e09 commit 6ac109f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SysBot.Pokemon/Actions/PokeRoutineExecutor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ public async Task<bool> TryReconnect(int attempts, int extraDelay, SwitchProtoco
6868
// USB can have several reasons for connection loss, some of which is not recoverable (power loss, sleep). Only deal with WiFi for now.
6969
if (protocol is SwitchProtocol.WiFi)
7070
{
71-
// If ReconnectAttempts is set to -1, this should allow it to reconnect indefinitely.
72-
for (int i = 0; i < attempts; i++)
71+
// If ReconnectAttempts is set to -1, this should allow it to reconnect (essentially) indefinitely.
72+
for (int i = 0; i < (uint)attempts; i++)
7373
{
7474
LogUtil.LogInfo($"Trying to reconnect... ({i + 1})", Connection.Label);
7575
Connection.Reset();

0 commit comments

Comments
 (0)