Trying to do BeforeParsing mk 2
We can't ignore disambiguation after all.
This commit is contained in:
parent
c832e30b61
commit
9f5f797a6a
23
examine_en.h
23
examine_en.h
|
@ -1,21 +1,24 @@
|
||||||
Global thing_to_examine;
|
Global thing_to_examine;
|
||||||
|
|
||||||
[ UnknownVerb word thing n i;
|
[ 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.
|
||||||
objectloop ( thing provides name) {
|
objectloop ( thing provides name) {
|
||||||
if (TestScope(thing, player)) {
|
if (TestScope(thing, player)) {
|
||||||
n = thing.#name / WORDSIZE;
|
n = thing.#name / WORDSIZE;
|
||||||
for(i = 0 : i < n : i++)
|
for(i = 0 : i < n : i++)
|
||||||
if (thing.&name-->i == word) {
|
if (thing.&name-->i == thing_to_examine) {
|
||||||
thing_to_examine = thing;
|
! At least one such thing exists, we can alter the input
|
||||||
return 'unknown';
|
buffer->0 = 'examine';
|
||||||
|
buffer->1 = thing_to_examine;
|
||||||
|
Tokenise__(buffer, parse);
|
||||||
|
rtrue;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
rfalse;
|
rfalse;
|
||||||
];
|
];
|
||||||
|
|
||||||
[ ExamineObjectSub;
|
|
||||||
<< Examine (thing_to_examine) >>;
|
|
||||||
];
|
|
||||||
|
|
||||||
verb 'unknown' * -> ExamineObject;
|
|
||||||
|
|
Loading…
Reference in a new issue