From 1466f448ee1aefcead983f99cd404a5e68fae95e Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Thu, 4 Mar 2021 21:17:35 +0000 Subject: [PATCH] Pause for 0.5 s when finding a bad crop --- jobs.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jobs.py b/jobs.py index 906a315..6f7bfb4 100644 --- a/jobs.py +++ b/jobs.py @@ -166,6 +166,14 @@ class GatherCropStates: self.state = self.going_to_crop else: self.bad_crops.append(self.crop) + self.wait_time = 0.5 + self.state = self.wait_to_restart + + def wait_to_restart(self): + # prevent timeouts + if self.wait_time > 0: + self.wait_time -= utils.TICK + else: self.state = self.find_new_crop def going_to_crop(self):