fix: vendor failure non-fatal so maintenance always reaches stash
CRITICAL loot-loss bug: buy_consumables failure called end_game and returned BEFORE the stash step, so Pindle runes/items piled in inventory and were never banked (zero stash events across a whole session). Buying pots is optional (belt refills from drops); stashing loot is the point. Now warn + re-anchor + fall through to stash. Also raise max_maintenance_time_s 120->240 so the A5 vendor thrash completes and reaches stash instead of timing out first (transitional — disappears once a Diablo run shifts spawns to A4). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -78,7 +78,7 @@ max_game_length_s=900
|
||||
; max_maintenance_time_s: if the town maintenance loop (heal/buy/stash/repair) takes
|
||||
; longer than this many seconds, save-and-exit and rejoin a fresh game.
|
||||
; Prevents the bot staying stuck in A5 town forever when NPCs or pathing fail.
|
||||
max_maintenance_time_s=120
|
||||
max_maintenance_time_s=240
|
||||
; auto_downgrade_threshold: if combined chickens+deaths exceed this number within 1 hour,
|
||||
; bot automatically lowers difficulty by one tier (hell->nightmare->normal) and restarts.
|
||||
; Set to 0 to disable. (NOTE: feature is parsed but not yet active in bot logic)
|
||||
|
||||
13
src/bot.py
13
src/bot.py
@@ -587,13 +587,14 @@ class Bot:
|
||||
sell_items = any([item.sell for item in items]) if items else None
|
||||
Logger.debug(f"Needs: {consumables.get_needs()}")
|
||||
else:
|
||||
reason = "Maintenance failed [step: buy_consumables] — vendor NPC not found after retry"
|
||||
Logger.error(reason)
|
||||
# NON-FATAL: buying pots is optional (belt refills from drops), but
|
||||
# STASHING loot is the whole point of the run. Do NOT end the game
|
||||
# here — that skips the stash step and strands picked-up runes/items
|
||||
# in inventory forever. Re-anchor and fall through to stash.
|
||||
reason = "Buy consumables failed (vendor not found) — continuing to stash without buying"
|
||||
Logger.warning(reason)
|
||||
self._save_error_screenshot("maintenance", reason)
|
||||
if not self._game_stats.get_failure_reason():
|
||||
self._game_stats.set_failure_reason(reason)
|
||||
self.trigger_or_stop("end_game", failed=True)
|
||||
return
|
||||
self._curr_loc = self._verify_town_location(prev_buy_loc)
|
||||
elif meters.get_health(img) <= Config().char["take_rejuv_potion_health"] or meters.get_mana(img) <= Config().char["take_rejuv_potion_mana"]:
|
||||
Logger.info("Healing at next possible Vendor")
|
||||
self._maintenance_step = "heal"
|
||||
|
||||
Reference in New Issue
Block a user