1
0
Fork 0

restore UnknownVerb

This commit is contained in:
Alexander Yakovlev 2019-08-15 00:17:09 +07:00
parent 9f5f797a6a
commit 2dcf0010ad
Signed by: oreolek
GPG key ID: 1CDC4B7820C93BD3

View file

@ -1,24 +1,17 @@
Global thing_to_examine;
[ BeforeParsing thing n i;
if (num_words > 1) {
rfalse;
}
thing_to_examine = NextWord();
! Check that such thing exists in scope, so that we don't catch
! compass directions or gibberish.
[ UnknownVerb thing;
objectloop ( thing provides name) {
if (TestScope(thing, player)) {
n = thing.#name / WORDSIZE;
for(i = 0 : i < n : i++)
if (thing.&name-->i == thing_to_examine) {
! At least one such thing exists, we can alter the input
buffer->0 = 'examine';
buffer->1 = thing_to_examine;
Tokenise__(buffer, parse);
rtrue;
}
if (TestScope(thing, player) && Refers(thing, 1)) {
thing_to_examine = thing;
return 'unknown';
};
};
rfalse;
];
[ ExamineObjectSub;
<< Examine (thing_to_examine) >>;
];
verb 'unknown' * -> ExamineObject;