aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2019-06-14 21:40:07 -0700
committerPaul Gilbert2019-06-14 21:40:07 -0700
commitf7e389db3b6625f2fa4d978b9b591e32e40ff2ff (patch)
tree6132582abe988fb42d07ccd3275247164935e894 /engines
parent5f7955daa547fbc1c65280c753b90ffccb4b677c (diff)
downloadscummvm-rg350-f7e389db3b6625f2fa4d978b9b591e32e40ff2ff.tar.gz
scummvm-rg350-f7e389db3b6625f2fa4d978b9b591e32e40ff2ff.tar.bz2
scummvm-rg350-f7e389db3b6625f2fa4d978b9b591e32e40ff2ff.zip
GLK: ADVSYS: Fix parsing input words
Diffstat (limited to 'engines')
-rw-r--r--engines/glk/advsys/glk_interface.cpp9
-rw-r--r--engines/glk/advsys/vm.cpp4
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;
}
}