Stop as soon as materials run out

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-20 19:43:45 +01:00
parent 16f0384483
commit 8dd33cbb40
2 changed files with 17 additions and 0 deletions

View file

@ -2040,6 +2040,13 @@ def process_player(world: dict, player: dict, now: float, rng: random.Random | N
summary["resumed"] = back
else:
stop(player)
if player["action"] is current and "enemy" not in action and not current.get("plot2"):
# Out of materials: stop now, not once the next bar has filled.
reason = can_start(world, player, growing(player))
if reason:
stop(player, reason)
summary["stopped"] = reason
break
if player["action"] and limit < now and current["start"] < now:
current["start"] = now
return summary