Clean log and prompt pollution
This commit is contained in:
parent
12a8398f9f
commit
84b53cfd0c
@ -913,15 +913,7 @@ class GameEngine:
|
||||
|
||||
@staticmethod
|
||||
def _auto_prompt(book_log: str) -> str:
|
||||
"""Extract a player prompt from the narrative. Uses the last sentence."""
|
||||
lines = book_log.strip().splitlines()
|
||||
sentences = []
|
||||
for line in reversed(lines):
|
||||
line = line.strip()
|
||||
if not line:
|
||||
continue
|
||||
# Take last substantive line as the prompt
|
||||
return f"**What do you do?**\n\n{line}"
|
||||
"""Fallback player prompt."""
|
||||
return "**What do you do?**"
|
||||
|
||||
# ── Response Parsing ────────────────────────────────────────────────
|
||||
|
||||
@ -925,9 +925,6 @@ class ChaosTUI(App):
|
||||
# Log only after successful finalize — failed turns produce no side effects
|
||||
from datetime import datetime
|
||||
ts = datetime.now().strftime("%H:%M")
|
||||
if player_action:
|
||||
time_of_day = self._guess_time_of_day()
|
||||
self.engine.append_log(f"- **{time_of_day}** — {player_action}")
|
||||
if result.log_entry:
|
||||
self.engine.append_log(f"- **{ts}** — {result.log_entry}")
|
||||
elif result.book_log:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user