trinity icon indicating copy to clipboard operation
trinity copied to clipboard

The parser asks if you mean the back door or the white door, even when the white door is gone

Open eriktorbjorn opened this issue 4 years ago • 0 comments

>LOOK
Herb Garden

A tall fence protects the neat rows of herbs from predators. The only exit is
the open back door of the cottage, leading west.

Another giant toadstool has taken root in a patch of thyme.

A triangular shadow lies across the ground. Its sharp point rests exactly on the
toadstool.

A pile of refuse lies in the corner.

>EXAMINE WHITE DOOR
The white door you saw here before is gone now.

>EXAMINE DOOR
Which door do you mean, the back door or the white door?

The game does have a GENERIC-DOOR-F routine to help disambiguate between doors, but it's used mostly to make sure that you're referring to only one door at a time, and to make "OPEN" default to the closed door, etc. Perhaps it should do something like this? It seems to work when I try it:

diff --git a/misc.zil b/misc.zil
index cdfb718..71d5607 100644
--- a/misc.zil
+++ b/misc.zil
@@ -1377,6 +1377,9 @@
         <RTRUE>>
 
 <ROUTINE GENERIC-DOOR-F (TABLE "AUX" (PTR 1) (DOOR <>) LEN X)
+        <COND (<AND <HERE? ,IN-GARDEN>
+                    <IS? ,TS4-DOOR ,NOALL>>
+               <RETURN ,GARDEN-DOOR>)>
         <COND (<OR <EQUAL? ,P-NAM ,W?DOORS ,W?DOORWAYS>
                    <EQUAL? ,P-XNAM ,W?DOORS ,W?DOORWAYS>>
                <MORE-THAN-ONE "door">

I put it first in the routine so that "EXAMINE DOORS" wouldn't incorrectly claim that there are more than one.

eriktorbjorn avatar Sep 19 '20 08:09 eriktorbjorn