aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2019-06-16 16:03:58 -0700
committerPaul Gilbert2019-06-16 16:03:58 -0700
commitc7a93064159395faf340109cd96b54874b8c2d14 (patch)
treecf33362d47b02ae80b8593e80c10c90271134ca9 /engines
parenta9261a6d315a452dfb63ead326aa72fcc3075ae9 (diff)
downloadscummvm-rg350-c7a93064159395faf340109cd96b54874b8c2d14.tar.gz
scummvm-rg350-c7a93064159395faf340109cd96b54874b8c2d14.tar.bz2
scummvm-rg350-c7a93064159395faf340109cd96b54874b8c2d14.zip
GLK: ADVSYS: Fixes for get action
Diffstat (limited to 'engines')
-rw-r--r--engines/glk/advsys/game.cpp2
-rw-r--r--engines/glk/advsys/vm.cpp7
2 files changed, 5 insertions, 4 deletions
diff --git a/engines/glk/advsys/game.cpp b/engines/glk/advsys/game.cpp
index eca145176c..0465583f82 100644
--- a/engines/glk/advsys/game.cpp
+++ b/engines/glk/advsys/game.cpp
@@ -134,7 +134,7 @@ bool Game::init(Common::SeekableReadStream *s) {
decrypt(&_data[0], _size);
_wordTable = &_data[_wordTableOffset];
- _wordTypeTable = &_data[_wordTypeTableOffset];
+ _wordTypeTable = &_data[_wordTypeTableOffset - 1];
_objectTable = &_data[_objectTableOffset];
_actionTable = &_data[_actionTableOffset];
_variableTable = &_data[_variableTableOffset];
diff --git a/engines/glk/advsys/vm.cpp b/engines/glk/advsys/vm.cpp
index 33712bc525..bfc22e764c 100644
--- a/engines/glk/advsys/vm.cpp
+++ b/engines/glk/advsys/vm.cpp
@@ -467,7 +467,7 @@ bool VM::parseInput() {
// Get direct object, preposition, and/or indirect object
if (_wordPtr != _words.end()) {
// Get any direct objects
- noun1 = _adjectiveList.size();
+ noun1 = _adjectiveList.size() + 1;
for (;;) {
// Get the next direct object
if (!getNoun())
@@ -475,7 +475,7 @@ bool VM::parseInput() {
++cnt1;
// Check for more direct objects
- if (_wordPtr == _words.end() || getWordType(*_wordPtr))
+ if (_wordPtr == _words.end() || getWordType(*_wordPtr) != WT_CONJUNCTION)
break;
++_wordPtr;
}
@@ -617,7 +617,7 @@ uint VM::getNoun() {
// Add a noun entry to the list
Noun n;
n._adjective = &_adjectiveList[alStart];
- n._noun = *_wordPtr++;
+ n._noun = (_wordPtr == _words.end()) ? 0 : *_wordPtr++;
n._num = _wordPtr - _words.begin() - 1;
_nouns.push_back(n);
@@ -641,6 +641,7 @@ bool VM::getVerb() {
if (checkVerb(_verbs)) {
++_wordPtr;
} else {
+ _verbs.pop_back();
_verbs.push_back(_words.back());
if (checkVerb(_verbs)) {