From aa207dae02ebcfe672b940f71f6b539116168d50 Mon Sep 17 00:00:00 2001 From: Adam Saudagar Date: Mon, 3 May 2021 00:09:33 +0530 Subject: [PATCH] fixed divide by zero error --- fishy/engine/fullautofisher/engine.py | 6 +++--- fishy/engine/fullautofisher/mode/calibrator.py | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/fishy/engine/fullautofisher/engine.py b/fishy/engine/fullautofisher/engine.py index d3d5107..dc6bf90 100644 --- a/fishy/engine/fullautofisher/engine.py +++ b/fishy/engine/fullautofisher/engine.py @@ -89,7 +89,7 @@ class FullAuto(IEngine): if self.window.crop is None: log_raise("FishyQR not found") - if not self.calibrator.all_callibrated(): + if not self.calibrator.all_calibrated(): log_raise("you need to calibrate first") self.fisher.toggle_start() @@ -131,8 +131,8 @@ class FullAuto(IEngine): logging.error("set target first") return - if not self.calibrator.all_callibrated(): - logging.error("you need to callibrate first") + if not self.calibrator.all_calibrated(): + logging.error("you need to calibrate first") return current = self.get_coods() diff --git a/fishy/engine/fullautofisher/mode/calibrator.py b/fishy/engine/fullautofisher/mode/calibrator.py index a5cefc5..ec20ca6 100644 --- a/fishy/engine/fullautofisher/mode/calibrator.py +++ b/fishy/engine/fullautofisher/mode/calibrator.py @@ -62,8 +62,11 @@ class Calibrator(IMode): # endregion - def all_callibrated(self): - return self.move_factor is not None and self.rot_factor is not None + def all_calibrated(self): + return self.move_factor is not None and \ + self.rot_factor is not None and \ + self.move_factor != 0 and \ + self.rot_factor != 0 def toggle_show(self): self.engine.show_crop = not self.engine.show_crop