diff --git a/src/bot.py b/src/bot.py index 53bb25f..12ccbf8 100644 --- a/src/bot.py +++ b/src/bot.py @@ -537,7 +537,19 @@ class Bot: Logger.info("Buy consumables and/or sell items") self._maintenance_step = "buy_consumables" prev_buy_loc = self._curr_loc - self._curr_loc, result_items = self._town_manager.buy_consumables(self._curr_loc, items = items) + # A5 Malah is unreliable in the current patch (wandering NPC, stale body + # templates — fails most games). Buy at A4 Jamella instead when in A5. + buy_loc = self._curr_loc + if TownManager.get_act_from_location(buy_loc) == Location.A5_TOWN_START: + Logger.info("Buy consumables: in A5 — traveling to A4 Jamella (Malah unreliable)") + a4_loc = self._town_manager.go_to_act(4, buy_loc) + if a4_loc: + buy_loc = a4_loc + self._curr_loc = a4_loc + prev_buy_loc = a4_loc + else: + Logger.warning("Buy consumables: travel to A4 failed — trying A5 Malah anyway") + self._curr_loc, result_items = self._town_manager.buy_consumables(buy_loc, items = items) if self._curr_loc: items = result_items sell_items = any([item.sell for item in items]) if items else None