fix(game): suppress endings while the tutorial is active

A command during the walkthrough (e.g. use front_door -> fled) no longer ends
the game mid-tutorial; a pending ending fires once the tutorial finishes or is
skipped.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-01 22:09:06 +02:00
parent c5993d1236
commit 20d076832d
2 changed files with 37 additions and 0 deletions

View File

@@ -84,6 +84,11 @@ public class Game {
/** Ends the game if any ending's conditions are met, printing its screen. */
private void maybeEnd() {
// Don't end the game (win or lose) while the player is still in the tutorial —
// a pending ending fires once the walkthrough finishes or is skipped.
if (tutorialGuide != null && tutorialGuide.isActive()) {
return;
}
Ending e = EndingEngine.triggered(ctx);
if (e != null) {
ctx.getIo().print(EndingEngine.render(e, ctx, ctx.getSession().getTurn()));