From 68fda96809ab160787fa79d31c1f749cfec1af15 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Sun, 15 Oct 2023 04:25:07 +0800 Subject: [PATCH] Fix: Wrong rotation is never corrected if allow_rotation_set turns False --- tasks/map/control/control.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasks/map/control/control.py b/tasks/map/control/control.py index 930f16032..367b5c36e 100644 --- a/tasks/map/control/control.py +++ b/tasks/map/control/control.py @@ -258,6 +258,8 @@ class MapControl(Combat, AimDetectorMixin): logger.info(f'Already at target rotation, ' f'current={last_rotation}, target={direction}, disallow rotation_set') allow_rotation_set = False + if not allow_rotation_set and rotation_interval.reached_and_reset(): + last_rotation = self.minimap.rotation if allow_rotation_set and rotation_interval.reached(): if self.handle_rotation_set(direction, threshold=10): rotation_interval.reset() @@ -278,6 +280,8 @@ class MapControl(Combat, AimDetectorMixin): logger.info(f'Already at target rotation, ' f'current={last_rotation}, target={direction}, disallow rotation_set') allow_rotation_set = False + if not allow_rotation_set and rotation_interval.reached_and_reset(): + last_rotation = self.minimap.rotation if allow_rotation_set and rotation_interval.reached(): if self.handle_rotation_set(direction, threshold=10): rotation_interval.reset() @@ -294,6 +298,8 @@ class MapControl(Combat, AimDetectorMixin): if allow_rotation_set: last_rotation = self.minimap.rotation allow_rotation_set = False + if not allow_rotation_set and rotation_interval.reached_and_reset(): + last_rotation = self.minimap.rotation if direction_interval.reached(): contact.set(direction=contact_direction(), run=True) direction_interval.reset() @@ -305,6 +311,8 @@ class MapControl(Combat, AimDetectorMixin): if allow_rotation_set: last_rotation = self.minimap.rotation allow_rotation_set = False + if not allow_rotation_set and rotation_interval.reached_and_reset(): + last_rotation = self.minimap.rotation if direction_interval.reached(): contact.set(direction=contact_direction(), run=False) direction_interval.reset()