GLK: COMPREHEND: Properly load the word map targets

This commit is contained in:
Paul Gilbert
2020-06-27 09:59:28 -07:00
parent 0cc397f9bc
commit cc2939669c
2 changed files with 4 additions and 5 deletions
+3 -5
View File
@@ -574,14 +574,13 @@ void GameData::parse_word_map(FileBuffer *fb) {
_wordMaps.push_back(map);
}
/* Consume two more null bytes (type and index were also null) */
fb->skip(2);
/*
* Parse the target word table. Each entry has a dictionary
* index/type. The first and second words from above map to the
* target word here. E.g. 'go north' -> 'north'.
*/
fb->seek(_header.addr_word_map_target);
for (i = 0; i < _wordMaps.size(); i++) {
WordMap &map = _wordMaps[i];
@@ -842,8 +841,7 @@ void GameData::parse_header(FileBuffer *fb) {
parse_header_le16(fb, &header->addr_dictionary);
parse_header_le16(fb, &header->addr_word_map);
/* FIXME - what is this for? */
parse_header_le16(fb, &dummy);
parse_header_le16(fb, &header->addr_word_map_target);
addr_dictionary_end = header->addr_word_map;
/* Rooms */
+1
View File
@@ -319,6 +319,7 @@ struct GameHeader {
uint16 addr_dictionary;
uint16 addr_word_map;
uint16 addr_word_map_target;
uint16 addr_strings;
uint16 addr_strings_end;