From e3eae4847a20223449ffd61dd6c7f54c8a4347c9 Mon Sep 17 00:00:00 2001 From: LmeSzinc <37934724+LmeSzinc@users.noreply.github.com> Date: Tue, 21 Nov 2023 11:49:59 +0800 Subject: [PATCH] Opt: Clear items at waypoints also --- tasks/rogue/route/base.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tasks/rogue/route/base.py b/tasks/rogue/route/base.py index 09e426406..a9e488ed9 100644 --- a/tasks/rogue/route/base.py +++ b/tasks/rogue/route/base.py @@ -140,9 +140,10 @@ class RouteBase(RouteBase_, RogueExit, RogueEvent, RogueReward): def clear_enemy(self, *waypoints): waypoints = ensure_waypoints(waypoints) - end_point = waypoints[-1] if self.plane.is_rogue_combat: - end_point.expected_enroute.append('item') + for point in waypoints: + if 'item' not in point.expected_enroute: + point.expected_enroute.append('item') return super().clear_enemy(*waypoints) def clear_item(self, *waypoints): @@ -191,7 +192,9 @@ class RouteBase(RouteBase_, RogueExit, RogueEvent, RogueReward): end_point.interact_radius = 7 end_point.expected_end.append(self._domain_event_expected_end) if self.plane.is_rogue_occurrence: - end_point.expected_enroute.append('item') + for point in waypoints: + if 'item' not in point.expected_enroute: + point.expected_enroute.append('item') result = self.goto(*waypoints) self.clear_occurrence()