From a05a13be67198e018e788c2d0fe4c1dede2425e5 Mon Sep 17 00:00:00 2001 From: alex Date: Wed, 10 Jun 2026 13:34:43 +0200 Subject: [PATCH] fix: on_init save+exit recovery when stranded mid-town with no visible marker Co-Authored-By: Claude Fable 5 --- src/bot.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bot.py b/src/bot.py index a57c608..53bb25f 100644 --- a/src/bot.py +++ b/src/bot.py @@ -333,6 +333,16 @@ class Bot: if (match := template_finder.search_and_wait(list(transition_to_screens.keys()), best_match=True)).valid: self.trigger_or_stop(transition_to_screens[match.name]) else: + # Stranded mid-town: town markers are position-dependent, so a char left + # standing away from the spawn shows NO known marker. If we're in-game, + # save+exit to character select and re-detect instead of giving up. + if is_visible(ScreenObjects.InGame): + Logger.warning("on_init: in-game but no known marker visible — save+exit to recover") + view.save_and_exit() + wait(2, 3) + if (match := template_finder.search_and_wait(list(transition_to_screens.keys()), best_match=True, timeout=20)).valid: + self.trigger_or_stop(transition_to_screens[match.name]) + return self.restart_or_exit(f"Failed to detect {list(transition_to_screens.keys())}.") def on_select_character(self):