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):