Sleep 0.1 s after failing to pathfind to prevent timeouts

This commit is contained in:
2021-04-25 23:39:57 +00:00
parent 7caa51f011
commit a49caaedf5
11 changed files with 12 additions and 18 deletions
+1 -8
View File
@@ -61,15 +61,8 @@ class GatherCropStates:
self.state = self.going_to_crop
else:
print('Cant get to it, blacklisting')
time.sleep(0.1)
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):