Map empty Enter to ZSCII 13 in read_char

MudInputStream.read_char() returned 0 for empty input, which no game
recognizes as a valid keypress. Now returns 13 (Enter/Return) so
"press any key" prompts like Curses' intro work from a MUD client.
This commit is contained in:
Jared Miller 2026-02-10 18:26:41 -05:00
parent fd977b91a2
commit c8d9bdfae9
Signed by: shmup
GPG key ID: 22B5C6D66A38B06C

View file

@ -107,7 +107,9 @@ class MudInputStream(zstream.ZInputStream):
text = self._input_queue.get()
if text:
return ord(text[0])
return 0
# Player hit Enter with no text — return 13 (ZSCII Enter/Return)
# so "press any key" prompts work in a line-oriented MUD client.
return 13
def feed(self, text: str):
self._input_queue.put(text)