diff --git a/config/params.ini b/config/params.ini index 4bd0040..501861a 100644 --- a/config/params.ini +++ b/config/params.ini @@ -217,6 +217,10 @@ skill_mistake_chance = 0.015 ; run_mephisto (Act 3 Durance of Hate) ; run_baal (Act 5 Throne of Destruction) ; run_baal_xp (Join public Baal games, hide, collect XP, leave — see [baal_xp]) +; The leech is self-contained: it leaves the public game and re-enters its own +; game inside the cycle, so it must NOT sit between real runs in the rotation. +; Keep it out of order= (the profile layer may re-arm it between cycles) and +; enable it with run_baal_xp=1 in the profile's [routes] section. order=run_pindle [char] diff --git a/src/bot.py b/src/bot.py index b4cce9c..530263a 100644 --- a/src/bot.py +++ b/src/bot.py @@ -481,6 +481,20 @@ class Bot: if self._do_runs[key]: self.trigger_or_stop(key) return + # No route is armed. A healthy leech re-arms itself from on_end_run + # (_baal_xp_rearm), but a failure path that skipped the rearm (or a + # profile [routes] section that does not list run_baal_xp) leaves the + # flag down and this branch would end_game - the controller then + # restarts D2R into a brand new game that is immediately left again, + # burning a game and a cycle for nothing. Re-arm and go again; the + # _BAAL_XP_MAX_CONSECUTIVE_FAILS breaker in _baal_xp_rearm still + # hands off to end_game after enough real failures in a row. + if self._baal_xp_only(): + Logger.info("baal_xp: no route armed - re-arming the leech for another cycle") + self._do_runs["run_baal_xp"] = True + Config().routes["run_baal_xp"] = True + self.trigger_or_stop("run_baal_xp") + return self.trigger_or_stop("end_game") return @@ -965,7 +979,10 @@ class Bot: # for a town that is not there. if self._baal_xp_only(): self._baal_xp_reenter_own_game() - elif not self._curr_loc: + set_pause_state(True) + self.trigger_or_stop("maintenance") + return + if not self._curr_loc: self._curr_loc = self._verify_town_location() set_pause_state(True) self.trigger_or_stop("maintenance")