the-infocom-files / deadline

Deadline
4 stars 3 forks source link

"FILL <object>" prints the wrong message when there is water nearby #26

Open eriktorbjorn opened 5 years ago

eriktorbjorn commented 5 years ago
>EXAMINE LAKE
Surely you don't suspect the fish also?

>FILL BOTTLE
There's nothing to fill it with.

This is what V-FILL looks like:

<ROUTINE V-FILL ()
     <COND (<NOT ,PRSI>
        <COND (<GLOBAL-IN? ,GLOBAL-WATER ,HERE>
               <PERFORM ,V?FILL ,PRSO ,GLOBAL-WATER>)
              (T
               <TELL "There's nothing to fill it with." CR>)>)
           (T <TELL "You can't do that." CR>)>>

So it seems to me that what it should print is "You can't do that." when there is water nearby.

The problem is that GLOBAL-IN? looks for local global objects, and GLOBAL-WATER is a global object.

So what it should look for is probably the LAKE object.

The LAKE object is local global to WEST-LAWN, EAST-LAWN and NORTH-LAWN. It should perhaps also be local global to BEHIND-SHED, since going east from there tells you that you can't go into the lake.

There are also a couple of other local global objects that should be a source of water. At the very least SINK, perhaps also SHOWER.

So something like this:

<ROUTINE V-FILL ()
     <COND (<NOT ,PRSI>
        <COND (<OR <GLOBAL-IN? ,LAKE ,HERE>
               <GLOBAL-IN? ,SINK ,HERE>
               <GLOBAL-IN? ,SHOWER ,HERE>>
               <PERFORM ,V?FILL ,PRSO ,GLOBAL-WATER>)
              (T
               <TELL "There's nothing to fill it with." CR>)>)
           (T <TELL "You can't do that." CR>)>>

Of course, it's a very minor point since you still can't actually fill anything with water.

eriktorbjorn commented 5 years ago

I just realized that there is also a PRE-FILL routine:

<ROUTINE PRE-FILL ("AUX" TX)
     <COND (<AND <NOT ,PRSI> <SET TX <GETPT ,HERE ,P?GLOBAL>>>
        <COND (<ZMEMQB ,GLOBAL-WATER .TX <PTSIZE .TX>>
               <SETG PRSI ,GLOBAL-WATER>
               <RFALSE>)
              (T
               <TELL "There's nothing to fill it with." CR>
               <RTRUE>)>)>
     <COND (<NOT <EQUAL? ,PRSI ,GLOBAL-WATER>>
        <PERFORM ,V?PUT ,PRSI ,PRSO>
        <RTRUE>)>>

But it's not actually used, since it's not in any syntax definition. Which is good, since that one also refers to GLOBAL-WATER.