diff --git a/src/mudlib/zmachine/zlexer.py b/src/mudlib/zmachine/zlexer.py index ad31417..378ea23 100644 --- a/src/mudlib/zmachine/zlexer.py +++ b/src/mudlib/zmachine/zlexer.py @@ -124,9 +124,13 @@ class ZLexer: token_list = self._tokenise_string(string, separators) + # Truncate to dictionary resolution (6 chars V1-3, 9 chars V4+) + max_word_len = 6 if self._memory.version <= 3 else 9 + final_list = [] for word in token_list: - byte_addr = dict.get(word, 0) + lookup_key = word[:max_word_len] + byte_addr = dict.get(lookup_key, 0) final_list.append([word, byte_addr]) return final_list