diff options
-rw-r--r-- | engines/glk/advsys/glk_interface.cpp | 9 | ||||
-rw-r--r-- | engines/glk/advsys/vm.cpp | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/engines/glk/advsys/glk_interface.cpp b/engines/glk/advsys/glk_interface.cpp index 3ec2d336c8..01abd2fae3 100644 --- a/engines/glk/advsys/glk_interface.cpp +++ b/engines/glk/advsys/glk_interface.cpp @@ -50,12 +50,13 @@ Common::String GlkInterface::readLine() { glk_select(&ev); if (ev.type == evtype_Quit) return ""; - else if (ev.type == evtype_LineInput) - break; + else if (ev.type == evtype_LineInput) { + line[ev.val1] = '\0'; + return Common::String(line); + } } while (!shouldQuit() && ev.type != evtype_Quit); - line[199] = '\0'; - return Common::String(line); + return ""; } } // End of namespace AdvSys diff --git a/engines/glk/advsys/vm.cpp b/engines/glk/advsys/vm.cpp index 95e1cecdb9..a2ce0f2832 100644 --- a/engines/glk/advsys/vm.cpp +++ b/engines/glk/advsys/vm.cpp @@ -590,11 +590,11 @@ bool VM::getWord(Common::String &line) { if (iw._number) { _words.push_back(iw); - return false; + return true; } else { Common::String msg = Common::String::format(_("I don't know the word \"%s\".\n"), iw._text.c_str()); print(msg); - return true; + return false; } } |