Skip to content

Commit

Permalink
No inf whiles
Browse files Browse the repository at this point in the history
  • Loading branch information
thatguy11325 committed Jun 1, 2024
1 parent b7380ac commit 9cc652d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pokemonred_puffer/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,8 @@ def cut_if_next(self):
self.pyboy.tick(self.action_freq, render=True)

# find pokemon with cut
while True:
# We run this over all pokemon so we dont end up in an infinite for loop
for _ in range(7):
self.pyboy.send_input(WindowEvent.PRESS_ARROW_DOWN)
self.pyboy.send_input(WindowEvent.RELEASE_ARROW_DOWN, delay=8)
self.pyboy.tick(self.action_freq, render=True)
Expand Down

0 comments on commit 9cc652d

Please sign in to comment.